Error: No provider for http in constructor parameter with Ionic

后端 未结 2 1620
长情又很酷
长情又很酷 2021-01-27 00:14

I\'m following a tutorial in Portuguese that teaches how to build your first Ionic application.

After installing npm, node.js, angular, Ionic and Cordova using last vers

2条回答
  •  忘掉有多难
    2021-01-27 00:40

    SOLUTION: HTTP_PROVIDERS were removed from angular2 and were replaced by: HttpModule.

    All I had to do was add:

    import { HttpModule } from '@angular/http';
    

    To src/app/app.module.ts and then:

    imports: [
      BrowserModule,
      HttpModule,
      IonicModule.forRoot(MyApp)
    ],
    

    And done. Thank you so much for everyone.

提交回复
热议问题