Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Directive({
- selector: '[sidebar]'
- })
- export class SidebarDirective {
- private _viewRef : ViewRef;
- constructor( private _sidebarService: SidebarService,
- public tpl: TemplateRef<any> ) {
- }
- ngOnInit() {
- this._viewRef = this._sidebarService.vcr.createEmbeddedView(this.tpl);
- }
- ngOnDestroy() {
- this._viewRef.destroy();
- }
- }
Add Comment
Please, Sign In to add comment