Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import { untilDestroyed } from 'ngx-take-until-destroy';
  2.  
  3. @Directive({
  4. selector: '[widgetViewMode]'
  5. })
  6. export class WidgetViewModeDirective {
  7. @Input('widgetViewMode') id: ID;
  8.  
  9. constructor( private widgetsQuery: WidgetsQuery ) {
  10. }
  11.  
  12. ngOnInit() {
  13. this.widgetsQuery.ui.selectEntity(this.id).pipe(
  14. untilDestroyed(this)
  15. ).subscribe(viewMode => ....toggle a CSS class)
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement