I now use npm install @types/angular
with TypeScript 2.0 and the experience so far has been much smoother than typings
was.
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 newer typings
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 result NAME: 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
?
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
) 🌹
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With