Installing angular 1.5 typings
Solution 1
I see that although it does declare a global angular variable, it also declares a module "angular"
The whole file is still global. i.e. there can be only one declare module "angular"
. Hence you still need to global flag (typings install dt~angular --global
) 🌹
Solution 2
with TypeScript 2.0, you can make package.json
file like this:
{
...
"dependencies": {
"@types/angular": "^1.5.6",
}
...
}
Now, you can just run npm install
!
Aaron Beall
Love to create things on the web. Currently ♥ TypeScript, React, Redux, NodeJS, Webpack. Yes, I'm available for hire. Feel free to contact me.
Updated on June 19, 2022Comments
-
Aaron Beall about 2 years
Update 3/26/2017
I now use
npm install @types/angular
with TypeScript 2.0 and the experience so far has been much smoother thantypings
was.Original
I have an Angular 1.5 project using ES6 modules and Webpack, which is very similar to this starter project.
I am attempting to install typings for Angular 1.5. I've used
tsd
in the past, but this is the first time I've tried to use the newertypings
manager.When I try
typings install angular
I get:"Unable to find "angular" ("npm") in the registry."
When I run
typings search angular
I see a resultNAME: angular, SOURCE: dt
.When I try
typings install angular dt~angular
I get:"Attempted to compile "angular" as an external module, but it looks like a global module."
However when I look at DefinitelyTyped/angular.d.ts I see that although it does declare a global
angular
variable, it also declares a module"angular"
, as many of the DefinitelyTyped definitions do to support UMD.How can I get this to work with typings? Or should I just stick with
tsd
? -
eusoj almost 8 yearsIf jQueryStatic warning appears, try: typings install dt~jquery --global --save
-
dbardakov almost 6 yearsSince Typings are deprecated, use npm for the purpose, like in the next answer