我编写了在 angular 2 中使用管道的组件。现在我试图降级要在我的 angular 1.5 中使用的组件:
angular.module('myApp')
.directive('Item', downgradeComponent({component: ItemComponent, inputs: ['item'], outputs: ['onTagRemoved'] }) as angular.IDirectiveFactory);
我的模板
ItemComponent
正在使用新管道。降级时,我收到有关该管道的错误消息。systemjs.import error: Error: (SystemJS) Can't resolve all parameters for tagPipe: (?).
我需要将管道降级到吗?如何?
在搜索管道降级时没有找到任何东西。
最佳答案
你不能降级管道 - 重写它。请参阅 NG-CONF 2017 中的此演示文稿:
https://www.slideshare.net/jawache/migrating-from-angularjs-when-you-cant-use-the-word-big-bang
https://www.youtube.com/watch?v=4p1jG2QNc4U
关于angular - 如何降级用 angular2 编写的自定义管道以用于 angular 1.5?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43708834/