I'm using Angular cdk overlay and implement a modal service, how to add animations of my component which is attached to my overlay

Viewed 21

I'm using Angular cdk overlay and implement a modal service, how to add animations of my component which is attached to my overlay without bind :host styles to each components?

const portal = new ComponentPortal(
  component,
  null,
  ModalService.createInjector(context),
);

if (portal) {
  overlayRef.attach(portal);
}

this is my code to attah my component ref to overlay.

I would like to have a animate such as slideIn from bottom to top,

If I add animation to the SCSS file of each component, it works, but it is redundant. Can I do something in my service to bind :host styles to components?

0 Answers
Related