I just updated angular-cli (v1.1) and created a new project using ng new MyProj
.
Then I added and installed two dependencies to the project.json file:
"dependencies": {
...
"toastr": "2.1.2",
"spin": "0.0.1"
},
"devDependencies": {
...
"@types/toastr": "2.1.32",
"@types/spin": "2.3.30",
...
"typescript": "~2.3.3"
}
Then I updated the autogenerated app.component.ts adding this constructor:
constructor() {
toastr.success('Hi')
}
The IDE (visual studio code) do not return any error but when I serve the application using ng serve
I get the following error:
ERROR in ../A/src/app/app.component.ts (15,5): C annot find name 'toastr'.
I really cannot figure out what is wrong with that.
Thanks a lot