将 NG2 指令降级为 AngularJS [英] Downgrade NG2 Directive to AngularJS
本文介绍了将 NG2 指令降级为 AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
据我所知,我们可以降级 NG2 Components &服务成 AngularJS.但我想知道是否可以为 NG2 指令做到这一点?
So as far as I know we can downgrade NG2 Components & Services into AngularJS. But I'm wondering if it's possible to do that for NG2 Directives?
我已经阅读了升级/降级指南,但找不到任何内容.我找到了升级 AngularJS 指令的方法,但没有找到相反的方法!
I read the upgrade/downgrade guides already but I couldn't find anything. I found the way to upgrade AngularJS Directives but not the other way around!
类似的东西,但对于指令(这是针对组件的):
Something like this but for directive (This is for components):
angular.module('heroApp', [])
.controller('MainController', MainController)
.directive('heroDetail', downgradeComponent({
component: HeroDetailComponent,
inputs: ['hero'],
outputs: ['deleted']
}) as angular.IDirectiveFactory);
有什么帮助吗?
推荐答案
所以显然我们不需要降级 NG2 指令.只需将其作为声明添加到您的应用程序中即可.
So apparently we don't need to downgrade a NG2 Directive. Just add it as a declaration into your application and it will work.
这篇关于将 NG2 指令降级为 AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文