angular - import HTTP_PROVIDERS in app.component.ts -


when try import http_providers angular/http have error:

error:(3, 9) ts2305: module '"projectname/node_modules/@angular/http/index"' has no exported member 'http_providers'. 

this file content:

import { component } '@angular/core'; import {githubservice} './services/github.service'; import {http_providers}  '@angular/http';  @component({     selector: 'my-app',     template: '<h1>my first angular 2 app</h1><profile></profile>',     providers: [ http_providers, githubservice ] })  export class appcomponent { } 

if use >= rc.5 add httpmodule imports in @ngmodule instead:

@ngmodule({   imports: [httpmodule],   ... }) class appmodule {} 

Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -