Custom parent container for Angular material overlay container?
问题 Angular material creates overlay containers for various components such as their menu, snackbar and dialog components. How can I, in an easy way, decide which element a cdk-overlay-container should be appended to? Currently, it's appended to the body element. So if I trigger full screen mode for any other element than the body element, it won't be seen. Which of course is not what I want. 回答1: Basically create a class that extends OverlayContainer . Override the getContainerElement method