小编And*_*eas的帖子

未找到角度打字稿类型参考路径

我的问题是在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)

angularjs typescript gulp

7
推荐指数
1
解决办法
3661
查看次数

标签 统计

angularjs ×1

gulp ×1

typescript ×1