angularjs - Module 'ng' has no exported member 'IDirective' -
i implemeting angular 1 directive typescript. looks fine, compiles, receive following error in visual studio code editor:
module 'ng' has no exported member 'idirectivefactory'.
here code:
class mydirective implements ng.idirective { constructor(a, b) { ...... } static factory(): ng.idirectivefactory { const directive = (a, b) => new mydirective(a, b); directive.$inject = ['a', 'b']; return directive; } ///more code }; angular.module('module1').directive('mydirective', mydirective.factory());
i tried replace ng.idirectivefactory
angular.idirectivefactory
, , worked fine documentation says should use ng
module instead of angular
one.
any ideas ?
i guess you're importing angular way:
import * angular 'angular';
they import in documentation this:
import * ng 'angular';
they because it's shorter :).
Comments
Post a Comment