如何在Angular4中重新启动Pipe

时间:2017-10-02 13:24:05

标签: angular angular-components angular-pipe

如何在Angular4中重新启动Pipe?

我有一个使用Pipe

的组件

组件使用一些使用Pipe

的数据渲染一次

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

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

2 个答案:

答案 0 :(得分:0)

管道有pure

Pure and Impure Pipes

Pure Pipes未更改(不可变)

Impure Pipes将被更改(可变)

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

答案 1 :(得分:0)

private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { String orderNum = SO.Text; using (var stream = File.OpenRead(path)) { order = (Bitmap)Bitmap.FromStream(stream); } using (order) using (var graphics = Graphics.FromImage(order)) using (f) { graphics.DrawString(orderNum, f, System.Drawing.Brushes.White, order.Height / 2, order.Width / 2); order.Save(path); } } 中,string可以用作angularpipe

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

简单地说,
pure即使更改数组项也有效,而
impure仅加载impure-pipe有用。

如何使管道纯净或不纯?

pure-pipe

Click for awsome Demo Here

了解更多信息,请访问 https://angular.io/guide/pipes