Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { untilDestroyed } from 'ngx-take-until-destroy';
- @Directive({
- selector: '[widgetViewMode]'
- })
- export class WidgetViewModeDirective {
- @Input('widgetViewMode') id: ID;
- constructor( private widgetsQuery: WidgetsQuery ) {
- }
- ngOnInit() {
- this.widgetsQuery.ui.selectEntity(this.id).pipe(
- untilDestroyed(this)
- ).subscribe(viewMode => ....toggle a CSS class)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement