我在组件代码中添加了以下行
pipes: [ OrderByPipe ].
它显示以下错误
类型'{selector:string; templateUrl:string;管道:typeof OrderByPipe []; }'不能分配给'Component'类型的参数 . 对象文字只能指定已知属性,“组件”类型中不存在“管道” .
怎么解决这个问题
pipes 在 @Component() 中是旧的方式,不再支持
pipes
@Component()
添加管道
@NgModule({ declarations: [OrderByPipe], ... })
1 回答
pipes
在@Component()
中是旧的方式,不再支持添加管道