如何在Angular4中重新启动Pipe

问题描述 投票:0回答:2

如何在Angular4中重新启动Pipe?

我有一个使用Pipe的组件

组件使用一些使用Pipe的数据渲染一次

一些数据已更改,管道将更改

如何重新启动管道或重新启动组件?

angular angular-components angular-pipe
2个回答
0
投票

管道有atturibute pure

Pure and Impure Pipes

Pure Pipes没有改变(是不可变的)

Impure Pipes将被更改(可变)

@Pipe({ name: 'join', pure: false || true })


0
投票

angularpipe可以用作pureimpure

什么是纯净和不纯的管道?

简单来说, impure-pipe甚至可以更改数组项目 pure-pipe只工作component装载。

How to make pipe pure or impure?

@Pipe({
  name: 'sort',
  pure: true | false // true makes it pure and false makes it impure
})
export class myPipe implements PipeTransform {

  transform(value: any, args?: any): any {
    return null;
  }

}

Click for awsome Demo Here

https://angular.io/guide/pipes阅读更多内容

© www.soinside.com 2019 - 2024. All rights reserved.