Angular information is very few, and many pits, the error is not a good solution, study this took several days.
First, see if your anuglar version is 4.3.0 or above, httpclient is the newly added feature in anuglar4.3, view in Package.json
"@angular/animations": "^4.3.0", " @angular/common": "^4.3.0", "@angular/compiler": "^4.3.0", "@ Angular/core ":" ^4.3.0 ", " @angular/forms ":" ^4.3.0 ", " @angular/http ":" ^4.3.0 ", " @angular/ Platform-browser ":" ^4.3.0 ", " @angular/platform-browser-dynamic ":" ^4.3.0 ", " @angular/router ":" ^4.3.0 ",
1. Import in App.module.ts
Import {Httpclientmodule} from ' @angular/common/http ';
and join in imports:
Imports: [Httpclientmodule]
2. Join the Member module
Import {Httpclientmodule} from ' @angular/common/http '; constructor (private myhttp:httpclient) {}
The basic configuration is gone. Transferred from: http://www.cnblogs.com/cxd1008/p/7685789.html
Angular2~httpclientmodule Configuration