我刚刚升级到Ionic 3.0.1
这样我就可以使用LazyLoading
,既然我不能用我的自定义Pipes
:离子-3找不到管道
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'StripHTML'
})
export class StripHTML implements PipeTransform {
transform(value, args) {
let striped = value.replace(/(<([^>]+)>)/g, "");
if (args != null) {
if (args.split != null) {
striped = striped.split(args.split);
if (args.index != null) {
striped = striped[args.index];
}
}
}
return striped;
}
}
和app.module.ts
我已经把它添加到声明:
@NgModule({
declarations: [
........,
StripHTML
],
...
现在
当我试图在html
模板是错误的使用方法:
core.es5.js:1085 ERROR Error: Uncaught (in promise): Error: Template parse errors:
The pipe 'StripHTML' could not be found ("
<ion-card-content>
<ion-card-title style="font-size: 100%">
{{ [ERROR ->]product.title | StripHTML }}
</ion-card-title>
</ion-card-content>
"): ng:///HomeModule/[email protected]:17
有什么我在这里失踪?
我有一个类似的错误,因为迁移:找不到名称“PipeTransform” – jug