import - error TS2307: Cannot find module '@angular/common/http' for HttpClientModule -


i trying import httpclientmodule using following line in app.module.ts:

import { httpclientmodule } '@angular/common/http';

and

imports: [     ...     httpclientmodule,     ... ] 

however keep getting same error:

src/app/app.module.ts(4,38): error ts2307: cannot find module '@angular/common/http'.

despite exact lines being included in these tutorials:

how can fix , use httpclient ?

the new http client added in 4.3 version. you're using older angular version. need update project. go package.json , modify @angular/... entries include ^4.3.4 version.

also, if you're using systemjs need add 2 entries map:

'tslib': 'npm:tslib/tslib.js', '@angular/common/http': 'npm:@angular/common/bundles/common-http.umd.js', 

also see difference between http , httpclient in angular 4?


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -