Created
January 30, 2017 19:10
-
-
Save venkateshwarv/d6a546b2487e998536d8ad541d28411a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MdSnackBar Service | |
/** | |
* Places a new component as the content of the snack bar container. | |
*/ | |
private _attachSnackbarContent<T>(component: ComponentType<T>, | |
container: MdSnackBarContainer, | |
overlayRef: OverlayRef): MdSnackBarRef<T> { | |
let portal = new ComponentPortal(component); | |
let contentRef = container.attachComponentPortal(portal); | |
return new MdSnackBarRef(contentRef.instance, container, overlayRef); | |
} | |
// CcSnackBar Service | |
private _attachSnackbarContent<T>(component: ComponentType<T>, | |
container: MdSnackBarContainer, | |
overlayRef: OverlayRef): MdSnackBarRef<T> { | |
let portal = new ComponentPortal(SnackbarComponent); | |
let contentRef = container.attachComponentPortal(portal); | |
return new MdSnackBarRef(contentRef.instance, container, overlayRef); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment