Skip to content

Instantly share code, notes, and snippets.

@bbachi
Last active February 11, 2019 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbachi/fe893f2dffb2841c97057f0dfcbcb5b1 to your computer and use it in GitHub Desktop.
Save bbachi/fe893f2dffb2841c97057f0dfcbcb5b1 to your computer and use it in GitHub Desktop.
Old way of doing Http
import { HttpModule } from '@angular/http';
@NgModule({
declarations: [
AppComponent
],
imports: [
HttpModule,
],
providers: [],
bootstrap: [ AppComponent ]
})
export class AppModule { }
import { Http, Response, Headers, RequestOptions, ResponseContentType } from '@angular/http';
@Injectable()
export class AppService implements OnInit {
constructor(private http: Http) {}
ngOnInit(){
this.appConfig = this.http.get(this.configUrl);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment