据我所知,我们可以将NG2组件和服务降级为AngularJS . 但我想知道是否有可能为NG2指令做到这一点?
我已经阅读了升级/降级指南但我找不到任何东西 . 我找到了升级AngularJS指令的方法,但没有相反的方法!
这样的东西,但对于指令(这是为组件):
angular.module('heroApp', [])
.controller('MainController', MainController)
.directive('heroDetail', downgradeComponent({
component: HeroDetailComponent,
inputs: ['hero'],
outputs: ['deleted']
}) as angular.IDirectiveFactory);
有帮助吗?
1 回答
显然,我们不需要降级NG2指令 . 只需将其作为声明添加到您的应用程序中即可 .