Created
January 30, 2017 18:56
-
-
Save venkateshwarv/f6856c0d6ee5126177962e33f88c5daf 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 | |
/** | |
* Attaches the snack bar container component to the overlay. | |
*/ | |
private _attachSnackBarContainer(overlayRef: OverlayRef, | |
config: MdSnackBarConfig): MdSnackBarContainer { | |
let containerPortal = new ComponentPortal(MdSnackBarContainer, config.viewContainerRef); | |
let containerRef: ComponentRef<MdSnackBarContainer> = overlayRef.attach(containerPortal); | |
containerRef.instance.snackBarConfig = config; | |
return containerRef.instance; | |
} | |
// CcSnackBar Service | |
private _attachSnackBarContainer(overlayRef: OverlayRef, | |
config: MdSnackBarConfig) { | |
let containerPortal = new ComponentPortal(SnackbarContainerComponent, config.viewContainerRef); | |
let containerRef: ComponentRef<MdSnackBarContainer> = overlayRef.attach(containerPortal); | |
containerRef.instance.snackBarConfig = config; | |
console.log(containerRef.instance); | |
return containerRef.instance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment