Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identifier 'angular' must be imported from a module #2955

Closed
jonrimmer opened this issue Aug 31, 2016 · 6 comments
Closed

Identifier 'angular' must be imported from a module #2955

jonrimmer opened this issue Aug 31, 2016 · 6 comments
Labels
Milestone

Comments

@jonrimmer
Copy link

1.0.0-beta.1 gives a type error when used with TypeScript:

ERROR in [...]/node_modules/angular-ui-router/commonjs/ng1/services.d.ts
(2,27): error TS2686: Identifier 'angular' must be imported from a module
@jonrimmer
Copy link
Author

jonrimmer commented Aug 31, 2016

Repro here: https://github.com/jonrimmer/typescript-bug

npm install
./node_modules/.bin/tsc bug.ts

node_modules/angular-ui-router/commonjs/ng1/services.d.ts(2,27): error TS2686: Identifier 'angular' must be imported from a module

@jonrimmer
Copy link
Author

So, I was thinking this might be a TypeScript issue, so have raised it there as well: microsoft/TypeScript#10638 (comment)

@Gugic
Copy link

Gugic commented Aug 31, 2016

I believe it's not just ui-router's error, because i'm getting that one on each my file where i using interfaces from angular.

@jonrimmer
Copy link
Author

According to mhegazy:

this is an issue in angular-ui-router declaration file. The compiler tries to ensure that a UMD module is used consistently, either as a module or as a global.

File: node_modules\angular-ui-router\commonjs\ng1\services.d.ts

should be:

import * as angular from "angular";
import IInjectorService = angular.auto.IInjectorService;

@christopherthielen
Copy link
Contributor

thanks @jonrimmer

@christopherthielen christopherthielen added this to the 1.0.0-beta.3 milestone Sep 25, 2016
@christopherthielen
Copy link
Contributor

This was fixed in beta.3 via 71bfaa0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants