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
@types/angular-ui-router|angular-ui-bootstrap|angular-translate "Module 'angular' has no exported member 'ui'" #10154
Comments
This should be fixed by #10170 you can either use it as a module: import * as angular from 'angular';
import "angular-ui-router";
class Config {
static $inject = ['$stateProvider', '$urlRouterProvider'];
constructor($stateProvider: angular.ui.IStateProvider, $urlProvider: angular.ui.IUrlRouterProvider) {
/*...*/
}
}
angular.module('Module', []).config(Config); or as a global but use /// <reference types="angular" />
/// <reference types="angular-ui-router" />
class Config {
static $inject = ['$stateProvider', '$urlRouterProvider'];
constructor($stateProvider: angular.ui.IStateProvider, $urlProvider: angular.ui.IUrlRouterProvider) {
/*...*/
}
}
angular.module('Module', []).config(Config); |
@mhegazy is this the new behavior for 2.0+ when using
|
the latest in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0 looks right to me. can you point out what is not working for you? |
I'm using |
you need to import that too. |
please make a switch in tsconfig.json that makes it behave the old way, I can't refactor my project at this very moment :( |
what is the "old" way? if you are using declaration files you got from typings or tsd, it should work with no change. this is only for the |
I am also having the same issue. |
Same issue... Just installed @types/angular imported angular in typescript file: However ui namespace isn't available on ng. Getting: Module 'angular' has no exported member 'ui'. |
Why is this closed? Does that mean it's never going to be fixed, or is there another issue for it? (still broken for me) |
Still broken for me too |
And still is |
@asadsahi That's because Which must be installed separated:
|
Anyone found a solution yet ? |
I just got this issue when trying to upgrade angular-ui-router from 1.0.0-beta.1 to 1.0.0-rc.1. I also want to upgrade TS, and get rid of typing in favor of @types... All this I got in yeoman-fountain generated angular1 application. It makes my angry because I am wasting my time :( |
This is still an issue. My workaround for the time being:
Sometimes I just have to run the task manually, but most of the time it's done with postinstall script. |
I had the same This was due to the fact that yarn resolved angular with different versions. I had two entries for angular with different resolution in the yarn.lock file:
Removing the yarn.lock and rerunning yarn install solved the issue but it modified too many other dependency in my case. Using yarn install --flat would probably have solved the problem but I didn't want to change how all dependencies are resolved. So I fixed the issue by manually changing the yarn.lock file to
|
angular-ui-router/angular-ui-router.d.ts
file in this repo and had problems.angular-ui-router isn't working when using @types/angular-ui-router.
"Module 'angular' has no exported member 'ui'"
every file now is red, and won't compile
Looks like having a
<reference types="angular" />
alongside aimport * as angular from 'angular';
won't workSame thing happens with angular-ui-bootstrap
The modules that depend on
@types/angular
are outright broken. I'm not using angular global variable and when I doimport * as angular from 'angular'
then try to access a module namespace, such asangular.ui.bootstrap
,angular.translate
,angular.ui
, they all give the errorModule 'angular' has no exported member 'ui'
the code below fails:
The text was updated successfully, but these errors were encountered: