我正在使用ui路由器,我在解决一些数据,我想注入到我的自定义指令的解决方案,下面是代码,我在做什么
原文链接:https://www.f2er.com/angularjs/142764.htmlmodule portal { $stateProvider.state('portal',{ url: '/demo',template: tpl.html,abstract: true,resolve: { demoResolve:function(){ return 'foo';//here i am returing a promise } }); } module portal.directives{ export class demoDirevtive{ static $inject =['demoResolve']; constructor(demoResolve){ console.log(demoResolve) var directive: ng.IDirective = {}; directive.link = (scope,element,attrs,ctrl) => { }; directive.restrict = "EAC"; return directive; } } }
但我收到了未知供应商的错误