Source: https://stackoverflow.com/questions/33721276/angular-exception-no-provider-for-http
Import the HttpModule
import { HttpModule } from '@angular/http';
@NgModule({
imports: [ BrowserModule, HttpModule ],
providers: [],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export default class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);
Ideally you split up this code in two separate files. For further information read:
Không có nhận xét nào:
Đăng nhận xét