admin管理员组文章数量:1302406
I am trying to use this typescript definition file for ui-router
:
.d.ts
Here is the code at the top of the definition file:
// Type definitions for Angular JS 1.1.5+ (ui.router module)
// Project:
// Definitions by: Michel Salib <;
// Definitions:
/// <reference path="../angularjs/angular.d.ts" />
declare module ng.ui {
interface IState {
...
Here is how I am using it:
module MyModule
{
export class MyStateConfig
{
constructor(
// -> error on the word ng.ui on next line
private $stateProvider: ng.ui.IStateProvider,
private $urlRouterProvider: ng.ui.IUrlRouterProvider
...)
{
this.$stateProvider.state(...
This was working in Visual Studio but now with WebStorm I get a message saying "
module 'ng' has no exported member 'ui'
Can someone give me advice on this. Is this something to do with a different module system with WebStorm?
I am trying to use this typescript definition file for ui-router
:
https://github./borisyankov/DefinitelyTyped/blob/master/angular-ui/angular-ui-router.d.ts
Here is the code at the top of the definition file:
// Type definitions for Angular JS 1.1.5+ (ui.router module)
// Project: https://github./angular-ui/ui-router
// Definitions by: Michel Salib <https://github./michelsalib>
// Definitions: https://github./borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module ng.ui {
interface IState {
...
Here is how I am using it:
module MyModule
{
export class MyStateConfig
{
constructor(
// -> error on the word ng.ui on next line
private $stateProvider: ng.ui.IStateProvider,
private $urlRouterProvider: ng.ui.IUrlRouterProvider
...)
{
this.$stateProvider.state(...
This was working in Visual Studio but now with WebStorm I get a message saying "
module 'ng' has no exported member 'ui'
Can someone give me advice on this. Is this something to do with a different module system with WebStorm?
Share asked Dec 12, 2014 at 16:21 Samantha J T StarSamantha J T Star 32.8k89 gold badges256 silver badges441 bronze badges2 Answers
Reset to default 5Have you tried adding a reference ment in your module source file? Something like...
/// <reference path="path/to/angular-ui/angular-ui-router.d.ts" />
Visual Studio doesn't require this because its msbuild tasks automatically tell the piler to reference any definition that are included in the project. I'm guessing WebStorm doesn't use msbuild project files.
Ensure the @types/angular-ui-bootstrap npm package is installed.
npm install @types/angular-ui-bootstrap
Check your tsConfig.json file, in
pilerOptions
, look for atypes
array. Try removingtypes
or replacing withtypeRoots
. Something like this:"pilerOptions": { "target": "ES5", "sourceMap": true, .... .... "typeRoots": [ "node_modules/@types" ] },
本文标签:
版权声明:本文标题:javascript - module 'ng' has no exported member 'ui' when using ui-router type definition for ty 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741708819a2393718.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论