Last active
February 11, 2019 16:03
-
-
Save bbachi/fe893f2dffb2841c97057f0dfcbcb5b1 to your computer and use it in GitHub Desktop.
Old way of doing Http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpModule } from '@angular/http'; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], | |
imports: [ | |
HttpModule, | |
], | |
providers: [], | |
bootstrap: [ AppComponent ] | |
}) | |
export class AppModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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