NativeScript No provider for Http -


am following nativescript groceries typescript angular tutorial , got stuck in chapter 3 following errors.

exception: error in ./appcomponent class appcomponent_host - inline template:0:0 original exception: no provider http! original stacktrace: error: di exception @ noprovidererror.baseexception [as constructor] (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/facade/exceptions.js:27:23) @ noprovidererror.abstractprovidererror [as constructor] (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/di/reflective_exceptions.js:43:16) @ new noprovidererror (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/di/reflective_exceptions.js:80:16) @ reflectiveinjector_._throwornull (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/di/reflective_injector.js:786:19) @ reflectiveinjector_._getbykeydefault (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/di/reflective_injector.js:814:25) @ reflectiveinjector_._getbykey (/data/data/org.nativescript.groce 

i have gone , forth tutorial see if missed seems followed every steps diligently.

how resolve issue.

update

if got here because of nativescript angular2 typescript tutorial, next step fixes problem (at time of writing).

original

apparently, step missing tutorial.

i had add following 2 lines:

// app.module.ts  import { nativescripthttpmodule } "nativescript-angular";  nativescripthttpmodule 

i ended following (app.module.ts):

import { ngmodule } "@angular/core"; import { nativescriptformsmodule } "nativescript-angular/forms"; import { nativescriptmodule } "nativescript-angular/platform"; import { nativescripthttpmodule } "nativescript-angular";  import { appcomponent } "./app.component";  @ngmodule({   imports: [     nativescriptmodule,     nativescriptformsmodule,     nativescripthttpmodule   ],   declarations: [appcomponent],   bootstrap: [appcomponent] }) export class appmodule { } 

Comments

Popular posts from this blog

java - AEM: 403 Forbidden occurs when call a Post servlet -

ruby on rails - ActiveRecord order not working -

Google Alert - facebook