Skip to content

Instantly share code, notes, and snippets.

@cgatian
Created October 24, 2017 01:30
Show Gist options
  • Save cgatian/924101cdad2a8d5d27f50875da10df43 to your computer and use it in GitHub Desktop.
Save cgatian/924101cdad2a8d5d27f50875da10df43 to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-test',
template: `
<ng-content [cdkPortalHost]="_portalInstance"></ng-content>
`
})
export class TestComponent implements OnInit {
_portalInstance: Portal<any>;
constructor() { }
ngOnInit() {
this._portalInstance = new ComponentPortal(HeaderComponent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment