How to re-trigger all pure pipes on all component tree in Angular 2

前端 未结 6 2221
青春惊慌失措
青春惊慌失措 2021-02-12 09:29

I have pure pipe TranslatePipe that translates phrases using LocaleService that has locale$: Observable current locale. I al

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-12 10:05

    Read this angular documentation for detect changes on array that is going to use pipe.

    To fix that, create an new array(with new changes) and assign that to you array that you want to use in pipe. This time Angular detects that the array reference has changed. It executes the pipe and updates the display with the new array with new changes

    enter link description here

提交回复
热议问题