SCION Workbench | Projects Overview | Changelog | Contributing | Sponsoring |
---|
SCION Workbench > How To Guides > View
A view can be closed via the view's handle WorkbenchView
, the WorkbenchService
, or the WorkbenchRouter
.
Inject WorkbenchView
handle and invoke the close
method.
import {inject} from '@angular/core';
import {WorkbenchView} from '@scion/workbench';
inject(WorkbenchView).close();
Inject WorkbenchService
and invoke closeViews
, passing the ids of the views to close.
import {inject} from '@angular/core';
import {WorkbenchService} from '@scion/workbench';
inject(WorkbenchService).closeViews('view.1', 'view.2');
The router supports for closing views matching the routing commands by setting close
in navigation extras.
Matrix parameters do not affect view resolution. The path supports the asterisk wildcard segment (*
) to match views with any value in a segment. To close a specific view, set a view target instead of a path.
import {inject} from '@angular/core';
import {WorkbenchRouter} from '@scion/workbench';
inject(WorkbenchRouter).navigate(['path/*/view'], {close: true});