In these two videos, I create the multi-select-options component as
<ng-template #template>
<ng-content/>
</ng-template>
create(templateRef: TemplateRef<unknown>): HTMLElement {
const embeddedViewRef = this.container.createEmbeddedView(templateRef)
this.embeddedViewRef = embeddedViewRef;
return (embeddedViewRef.rootNodes as HTMLElement[]).find(n => n.nodeType == Node.ELEMENT_NODE)!;
}
destroy(): void {
this.embeddedViewRef?.destroy()
this.embeddedViewRef = undefined
}
When I provide leave animation using animate.leave, it is created with .leave class again in the next create.