Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular typescript typings reference path not found

My problem is an error during gulp compilation:

error TS6053: File '/Users/myname/dev2/test2/typings/angularjs/angular.d.ts' not found.

But the file realy exists! If i copied the d.ts files in the foo folder it will work. But that can't be a valid way. How do I have to define a valid reference? And aren't project-absolute paths possible?

paths:

source/modules/foo/controller.ts
typings/..

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';
       }
   }
}
like image 587
Andreas Avatar asked May 30 '15 10:05

Andreas


1 Answers

I found the issue!:

It was a setting in the gulpfile.js:

var tsResult = gulp.src('source/modules/**/*.ts')
    .pipe(ts({
        declarationFiles: true,
        noExternalResolve: false
    }));

The setting noExternalResolve was on true which made it searched only below "modules".

Thanks mrhobo for response.

like image 155
Andreas Avatar answered Sep 19 '22 18:09

Andreas