【发布时间】:2015-04-22 21:56:50
【问题描述】:
当尝试引用外部模块时,Intellisense 会吐出一个错误...
Could not find symbol 'ng' in global module
或者..
Could not find symbol 'ng' in module 'App' // my main module
..即使我正确引用了打字稿定义(使用肯定类型):
_references.ts
/// <reference path="../../typings/tsd.d.ts" />
declare var angular: ng.IAngularStatic; // unable to find in global module
SomeDirective.ts
/// <reference path="_references.ts" />
module App {
export class SomeDirective implements ng.IDirective // unable to find in module 'App'
}
有趣的是,使用 grunt-typescript 编译 *.ts 文件可以正常工作,并且应用程序运行没有任何问题。
【问题讨论】:
标签: javascript angularjs typescript typescript1.4