Skip to content

Instantly share code, notes, and snippets.

@GreenFlag31
Last active August 13, 2023 08:24
Show Gist options
  • Save GreenFlag31/93e67be2fc3bade457d7674932f359a6 to your computer and use it in GitHub Desktop.
Save GreenFlag31/93e67be2fc3bade457d7674932f359a6 to your computer and use it in GitHub Desktop.
app component class
export class AppComponent {
// Query the #view element in the template, expecting it to be of type ViewContainerRef
// and store the reference in the variable vcr.
@ViewChild('view', { static: true, read: ViewContainerRef })
vcr!: ViewContainerRef;
constructor(private modalService: ModalService) {}
openModalTemplate(view: TemplateRef<Element>) {
this.modalService.open(this.vcr, view, {
animations: {
modal: {
enter: 'enter-slide-down 0.8s',
},
overlay: {
enter: 'fade-in 0.8s',
leave: 'fade-out 0.3s forwards',
},
},
size: {
width: '40rem',
},
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment