Angular 按枚举分类的管道角度2过滤器组件

Angular 按枚举分类的管道角度2过滤器组件,angular,pipe,Angular,Pipe,我有一个问题,我想按她的类别筛选我的组件列表,但我的管道不工作,你能帮我吗 这是我的烟斗: 从'@angular/core'导入{Pipe,PipeTransform}; @烟斗({ 名称:“匹配类别” }) 导出类MatchesCategoryPipe实现PipeTransform{ 转换(项目:数组) <{{c.selector}}>; {{c.description}} {{c.category}} 从'@angular/core'导入{Pipe,PipeTransform

我有一个问题,我想按她的类别筛选我的组件列表,但我的管道不工作,你能帮我吗

这是我的烟斗:

从'@angular/core'导入{Pipe,PipeTransform};
@烟斗({
名称:“匹配类别”
})
导出类MatchesCategoryPipe实现PipeTransform{
转换(项目:数组)
<{{c.selector}}>;
{{c.description}}
{{c.category}}
从'@angular/core'导入{Pipe,PipeTransform};
@烟斗({
名称:“matchesCategory”
})
导出类MathcesCategoryPipe实现PipeTransform{
转换(项目:数组,类别:字符串):数组{
返回items.filter(item=>item.category==category);
}
}

{{model.category}
管道类别
从“@angular/core”导入{Pipe,PipeTransform};
@烟斗({
名称:“匹配类别”
})
导出类MatchesCategoryPipe实现PipeTransform{
转换(项目:数组)
<{{c.selector}}>;
{{c.description}}
{{c.category}}
typeScript文件
从“@angular/core”导入{TypeDecorator}
进口{
装饰师,
制作装饰器
}来自“./decorators”
导出枚举组件类别{
FormControls='FormControls',
容器='容器',
box='box',
DataPresentation=‘数据表示’,
布局='布局',
杂项='杂项',
All='All'
}
导出接口组件描述符编辑器{
(obj:ComponentDescriptor):类型装饰器
新建(obj:ComponentDescriptor):ComponentDescriptor
}
导出接口描述符{
标题:字符串
描述:字符串
}
导出接口组件描述符扩展描述符{
类别:组件类别
创作日期:日期
更新日期?:日期
相关组件?:任何[]
标签?:字符串[]
不推荐?:布尔值

}
您是否已在app.module.ts中注册管道否我没有,但现在我已在app.module中写入,并且我有一个新错误我将错误日志发布到anwserremove[ngValue]=“'Form Controls'”“好,我的服务正在运行,但我没有我的分类日志。错误:Uncaught(承诺中):TypeError:无法读取未定义类型的属性“category”错误:无法读取Object.eval[作为updateDirectives](ng:///AppModule/ComponentContainer.ngfactory.js:307:109)处未定义的Object.debugUpdateDirectives[作为updateDirectives]的属性“category”无法读取未定义类型的属性“category”错误:无法读取Object.eval[作为updateDirectives]上未定义类型的属性“category”