File

src/app/core/ui/abstract-view/view-component-context.ts

Description

Service to share context for components that can be used both in dialogs (wrapped by DialogViewComponent) and in full screen (wrapped by RoutedViewComponent).

Index

Properties
Methods

Constructor

constructor(isDialog: boolean)
Parameters :
Name Type Optional
isDialog boolean No

Properties

actions
Type : ViewActionsComponent
Readonly changes$
Type : unknown
Default value : this.changes.asObservable()
Public isDialog
Type : boolean
title
Type : ViewTitleComponent

Methods

setActions
setActions(actions: ViewActionsComponent)
Parameters :
Name Type Optional
actions ViewActionsComponent No
Returns : void
setTitle
setTitle(title: ViewTitleComponent)
Parameters :
Name Type Optional
title ViewTitleComponent No
Returns : void
import { ViewActionsComponent } from "app/core/common-components/view-actions/view-actions.component";
import { ViewTitleComponent } from "app/core/common-components/view-title/view-title.component";
import { Subject } from "rxjs";

/**
 * Service to share context for components that can be used both
 * in dialogs (wrapped by DialogViewComponent) and
 * in full screen (wrapped by RoutedViewComponent).
 */
export class ViewComponentContext {
  title: ViewTitleComponent;
  actions: ViewActionsComponent;
  private readonly changes = new Subject<void>();
  readonly changes$ = this.changes.asObservable();

  constructor(public isDialog: boolean) {}

  setTitle(title: ViewTitleComponent) {
    this.title = title;
    this.changes.next();
  }

  setActions(actions: ViewActionsComponent) {
    this.actions = actions;
    this.changes.next();
  }
}

results matching ""

    No results matching ""