Andreas
Andreas

Reputation: 553

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';
       }
   }
}

Upvotes: 7

Views: 4133

Answers (1)

Andreas
Andreas

Reputation: 553

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.

Upvotes: 14

Related Questions