Error: No provider for http in constructor parameter with Ionic

后端 未结 2 1577
长情又很酷
长情又很酷 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:50

    Use the below code

    import {HTTP_PROVIDERS} from '@angular/http';
    
    provider : [ HTTP_PROVIDERS, ....
    
    
     ]
    

    The above answer was deprecated since angular4. However As I said in the comment,

    import { HttpModule } from '@angular/http';
    
    imports: [ HttpModule ]
    

提交回复
热议问题