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

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -