NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.94k forks source link

Popover do not destroy the content component when hiding the content #5688

Open tirelyl opened 4 years ago

tirelyl commented 4 years ago

What problem does this feature solve?

I have a loading component in popover which will increase after ngOnInit triggering. when the popover close, the loading compinent will be destroied, the loading process bar will start over again after popover opening.

there is a demo: demo

What does the proposed API look like?

Provides an API for popover , such as nzNotDestroyContent

asmallgod commented 4 years ago

You can extract the data source for <app-loading>, and I think it's easy to solve.

wzhudev commented 4 years ago

I debugged it and it seems that Popover works correctly. When togging its visibility, nz-popover does not re-create the overlay component.

IMHO, the reason may be that you put a component in the template

<ng-template #contentTemplate>
  <app-loading></app-loading>
</ng-template>
wzhudev commented 4 years ago

截屏2020-08-17 下午10 27 02

It seems that this property is always true and hence the view get re-created every time. Could you please take a look at this? @vthinkxie

vthinkxie commented 4 years ago

I will have a look, thanks @wendellhu95