And*_*eas 7 angularjs typescript gulp
我的问题是在gulp编译期间出错:
错误TS6053:找不到文件'/Users/myname/dev2/test2/typings/angularjs/angular.d.ts'.
但该文件确实存在!如果我复制foo文件夹中的d.ts文件,它将起作用.但这不是一种有效的方式.我如何定义有效的参考?并非项目绝对路径可能吗?
路径:
source/modules/foo/controller.ts
typings/..
Run Code Online (Sandbox Code Playgroud)
controller.ts:
/// <reference path="../../../typings/angularjs/angular.d.ts" />
module('app').controller("fooController",
[ "$scope",
($scope)
=> new Application.Controllers.fooController($scope)
]);
module Application.Controllers{
export class fooController{
constructor( $scope ){
$scope.name = 'I am foo Hans';
}
}
}
Run Code Online (Sandbox Code Playgroud)
And*_*eas 14
我发现了这个问题!:
这是gulpfile.js中的一个设置:
var tsResult = gulp.src('source/modules/**/*.ts')
.pipe(ts({
declarationFiles: true,
noExternalResolve: false
}));
Run Code Online (Sandbox Code Playgroud)
设置noExternalResolve为true,使其仅在"modules"下搜索.
感谢mrhobo的回复.
归档时间: |
|
查看次数: |
3661 次 |
最近记录: |