Angular typescript not found reference typing path

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 does exist! If I copied the d.ts files in the foo folder, it will work. But that may not be right. How do I determine a valid link? And aren't possible design paths possible?

ways:

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'; } } } 
+6
source share
1 answer

I found a problem !:

This was the setting in gulpfile.js:

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

The noExternalResolve parameter was true , which made it search only below the "modules".

Thanks mrhobo for the answer.

+13
source

Source: https://habr.com/ru/post/988215/


All Articles