Guest User

Untitled

a guest
Oct 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. @Directive({
  2. selector: '[sidebar]'
  3. })
  4. export class SidebarDirective {
  5. private _viewRef : ViewRef;
  6.  
  7. constructor( private _sidebarService: SidebarService,
  8. public tpl: TemplateRef<any> ) {
  9. }
  10.  
  11. ngOnInit() {
  12. this._viewRef = this._sidebarService.vcr.createEmbeddedView(this.tpl);
  13. }
  14.  
  15. ngOnDestroy() {
  16. this._viewRef.destroy();
  17. }
  18.  
  19. }
Add Comment
Please, Sign In to add comment