Created
October 24, 2017 01:34
-
-
Save cgatian/7d17b1d1dcd5bf9fb35d85ca8fb9db4e to your computer and use it in GitHub Desktop.
This file contains 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
@Component({ | |
selector: 'app-test', | |
template: ` | |
<ng-content [cdkPortalHost]="_portalInstance"></ng-content> | |
<ng-template cdkPortal #cartCount> | |
<div>Hello World</div> | |
</ng-template> | |
` | |
}) | |
export class TestComponent implements OnInit { | |
@ViewChild('cartCount') _portalInstance: TemplatePortal<any>; | |
constructor() { } | |
ngOnInit() { | |
this._portalInstance = _portalInstance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment