V
V
Vladislav Kh2017-09-26 19:35:36
Angular
Vladislav Kh, 2017-09-26 19:35:36

Error cannot find module '@angular/common/http' angular2?

Hello everyone, I'm studying angular, and I came across this
SSMaker.ru/65f59075 can you tell me what could be causing this error?
https://github.com/Cobr3n/ang2learn - here is the code if anything

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladislav Kh, 2017-09-28
@cobr3n

Everything turned out to be quite simple.

The problem is in the "angular-in-memory-web-api" version. You need to install not the latest version, but 0.2.4. The command looks like this: "npm install [email protected] --save". The point is that the new version of this "angular-in-memory-web-api" works with angular 4.3.0, and there the http module (or client) is implemented in the @angular/common/http folder, in these video tutorials we use the old angular version.

F
Fedor Sazonov, 2017-09-27
@Revenant20

The current recommendation is to use Angular Cli . Better take advantage of it. It will do a lot for you in terms of setting up the project. And if you use webstorm or vscode , then the dependencies will be added automatically (almost). Angular Cli uses webpack , not SystemJS. Angular Cli also exists in the form of plugins for popular IDEs.

U
Urukhayy, 2017-09-26
@Urukhayy

Try:
'@angular/http'

D
denismaster, 2017-09-26
@denismaster

@angular/common/httpavailable only from version 4.3.0.
Update Angular=)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question