0
にリフレッシュされていない私には、以下のパイプを持っている:イベント・エミッターがイベントを出力したときにパイプのサブスクリプション・イベント
{{ "value" | translationPipe | async }}
translationPipe {
constructor(otherService: OtherService, myService: MyService, _ref : ChangeDetectorRef) {
this.myService.myEventEmitter.subscribe(value -> {
_ref.markForCheck();
});
}
transform(value, args?) {
// this returns an api call observable
return this.otherService.doApiCall();
}
}
は、しかし、パイプの値がreobtainedされていません。
なぜそれが再評価されると思いますか? – yurzui
@yurzuiを呼び出して_ref.markForCheckを呼び出すとリバリュエーションが発生しますか? – mangusbrother
@mangusbrother変更検出のために* view *をマークします。パイプにはビューがありません。 – cgTag