Angular Cli projects are not conform with the angular documentation. For example
import {HTTP_PROVIDERS, Http} from 'angular2/http';
does not work
@doczoidberg , try this => import {HTTP_PROVIDERS, Http} from '@angular/http'
With the rc version, all namespace have change. https://github.com/angular/angular/blob/master/CHANGELOG.md
c:/temp/app1e/tmp/broccoli_type_script_compiler-input_base_path-rlvaekkB.tmp/0/src/main.ts (5, 30): Cannot find module '@angular/http'.
Maybe it's not present on your package.json. Can you check it ?
@doczoidberg If you are using the latest version of angular-cli you don't have the package installed by default. You need to run npm install @angular/http --save
works now, thanks
You should also inject HTTP_PROVIDERS in main.ts
bootstrap(HELLOAppComponent, [HTTP_PROVIDERS]);
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@doczoidberg If you are using the latest version of
angular-cliyou don't have the package installed by default. You need to runnpm install @angular/http --save