Skip to content

feat(modals): add an options to append modals to element #731

@zl810881283

Description

@zl810881283

I follow the modal doc, and find that I should do a small hack in the root component, which is need in my project. I wonder whether I can set modals to child component. what should I do?

import {Component, ViewContainerRef} from '@angular/core';

@Component({selector:'app-root'})
class AppRoot {
  public constructor(viewContainerRef:ViewContainerRef) {
    // You need this small hack in order to catch application root view container ref
    this.viewContainerRef = viewContainerRef;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions