I went through the Angular tutorial and going through the HTTP section https://angular.io/docs/ts/latest/tutorial/toh-pt6.html and noticed that the order in which the import is declared in NgModule makes a difference in whether it works Appendix. I would like to know why this is so.
In particular, this works:
@NgModule ({
imports: [
BrowserModule,
FormsModule,
HttpModule,
InMemoryWebApiModule.forRoot (InMemoryDataService),
AppRoutingModule
],
...
})
but the following. The list of heroes is not loading. Note that the HttpModule is declared AFTER InMemoryWebApiModule:
@NgModule ({
imports: [
BrowserModule,
FormsModule,
InMemoryWebApiModule.forRoot (InMemoryDataService),
HttpModule,
AppRoutingModule
],
...
})
The tutorial uses Angular 2.4.4. I noticed a problem in both Firefox and IE. I did not find anything in my Google searches that indicate the source of the problem.
source share