Runtime Error
Uncaught (in promise): Error: No provider for HTTP! Error
at g (http://localhost:8100/build/polyfills.js:3:7133)
at injectionError (http://localhost:8100/build/main.js:1511:86) at noProviderError (http://localhost:8100/build/main.js:1549:12)
at ReflectiveInjector_._throwOrNull (http://localhost:8100/build/main.js:3051:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:8100/build/main.js:3090:25)
at ReflectiveInjector_._getByKey (http://localhost:8100/build/main.js:3022:25) at ReflectiveInjector_.get (http://localhost:8100/build/main.js:2891:21)
at AppModuleInjector.get (ng:///AppModule/module.ngfactory.js:220:79)
at AppModuleInjector.getInternal (ng:///AppModule/module.ngfactory.js:427:43) at AppModuleInjector.NgModuleInjector.get (http://localhost:8100/build/main.js:3855:44)
at resolveDep (http://localhost:8100/build/main.js:11260:45)
at createClass (http://localhost:8100/build/main.js:11128:32)
at createDirectiveInstance (http://localhost:8100/build/main.js:10954:37)
at createViewNodes (http://localhost:8100/build/main.js:12303:49)
at createRootView (http://localhost:8100/build/main.js:12208:5)
Stack
Error: Uncaught (in promise): Error: No provider for HTTP!
Error
at g (http://localhost:8100/build/polyfills.js:3:7133)
at injectionError (http://localhost:8100/build/main.js:1511:86)
at noProviderError (http://localhost:8100/build/main.js:1549:12)
at ReflectiveInjector_._throwOrNull (http://localhost:8100/build/main.js:3051:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:8100/build/main.js:3090:25)
at ReflectiveInjector_._getByKey (http://localhost:8100/build/main.js:3022:25)
at ReflectiveInjector_.get (http://localhost:8100/build/main.js:2891:21)
at AppModuleInjector.get (ng:///AppModule/module.ngfactory.js:220:79)
at AppModuleInjector.getInternal (ng:///AppModule/module.ngfactory.js:427:43)
at AppModuleInjector.NgModuleInjector.get (http://localhost:8100/build/main.js:3855:44)
at resolveDep (http://localhost:8100/build/main.js:11260:45)
at createClass (http://localhost:8100/build/main.js:11128:32)
at createDirectiveInstance (http://localhost:8100/build/main.js:10954:37)
at createViewNodes (http://localhost:8100/build/main.js:12303:49)
at createRootView (http://localhost:8100/build/main.js:12208:5)
at g (http://localhost:8100/build/polyfills.js:3:7133)
at l (http://localhost:8100/build/polyfills.js:3:6251)
at http://localhost:8100/build/polyfills.js:3:6805
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15213)
at Object.onInvokeTask (http://localhost:8100/build/main.js:4415:37)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15134)
at n.runTask (http://localhost:8100/build/polyfills.js:3:10390)
at a (http://localhost:8100/build/polyfills.js:3:5313)
at HTMLButtonElement.invoke (http://localhost:8100/build/polyfills.js:3:16210)
Can you explain a bit more about what you are trying to do via http? If itâs âtalk to a backend REST interfaceâ, you donât want the ionic-native HTTP, you want Angularâs Http.
The guys already pointed you in the right direction. From what I can tell you accidentely try to import HTTP with capital letters, while should have this as an import statement:
import { Http } from '@angular/http';
you should then change public http: HTTP to public http: Http. Als make sure youâve imported the Http module into your app.module
Did you add the HTTPModule to your app.module? And did you at the import statement in the right component? And did you declare it inside your constructor? In other words, please show us what you did exactly BTW: this was an isue about http native. If you believe this is the same error, you can keep it over here. If you think this is a different issue, please open up a new issue to keep the topic clean
@IonicPage() @Component({
selector: âpage-dashboardâ,
templateUrl: âdashboard.htmlâ,
})
export class Dashboard {
public data : any;
public city: any;
public state: string;
public artisans: string;
public items:any=[];
public itemy:any=[];
public iteme:any=[];
public form : FormGroup;
Please fix your code, it isnât really readable like this. But what i already noticed is that youâre import HttpModule over ehre. You should do this inside of your app.module.ts, not in the component itself.
Also your code seems a little bit messy overall. Itâs a better design pattern to do these calls from a service/provider, not from within your controller itself.
If anyone didnât get the answer from that Ionic Native doc that was posted earlier ⌠youâre not alone. The answerâs not in there at all. dâoh!