How to use the @scion/workbench.WorkbenchModule.forChild function in @scion/workbench

To help you get started, we’ve selected a few @scion/workbench examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / popup-capability / popup-capability.module.ts View on Github external
import { WorkbenchModule } from '@scion/workbench';
import { CommonModule } from '@angular/common';
import { PopupOutletComponent } from './popup-outlet.component';
import { PopupIntentDispatcher } from './popup-intent-dispatcher.service';

/**
 * Built-in capability to show a popup.
 */
@NgModule({
  declarations: [
    PopupOutletComponent,
  ],
  imports: [
    CommonModule,
    CoreModule,
    WorkbenchModule.forChild(),
  ],
  providers: [
    {provide: APP_INITIALIZER, useFactory: provideModuleInitializerFn, multi: true, deps: [Injector]},
    PopupIntentDispatcher,
  ],
  entryComponents: [
    PopupOutletComponent,
  ],
})
export class PopupCapabilityModule {
}

export function provideModuleInitializerFn(injector: Injector): () => void {
  // use injector because Angular Router cannot be injected in `APP_INITIALIZER` function
  // do not return the function directly to not break the AOT build (add redundant assignment)
  const fn = (): void => injector.get(PopupIntentDispatcher).init();
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / view-capability / view-capability.module.ts View on Github external
import { WorkbenchModule } from '@scion/workbench';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { ViewOutletComponent } from './view-outlet.component';

/**
 * Built-in capability to show a view.
 */
@NgModule({
  declarations: [
    ViewOutletComponent,
  ],
  imports: [
    CommonModule,
    CoreModule,
    WorkbenchModule.forChild(),
    RouterModule.forChild([]),
  ],
  providers: [
    {provide: APP_INITIALIZER, useFactory: provideModuleInitializerFn, multi: true, deps: [Injector]},
    ViewIntentDispatcher,
  ],
  entryComponents: [
    ViewOutletComponent,
  ],
})
export class ViewCapabilityModule {
}

export function provideModuleInitializerFn(injector: Injector): () => void {
  // use injector because Angular Router cannot be injected in `APP_INITIALIZER` function
  // do not return the function directly to not break the AOT build (add redundant assignment)
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / messagebox-capability / message-box-capability.module.ts View on Github external
*/

import { NgModule } from '@angular/core';
import { WorkbenchModule } from '@scion/workbench';
import { MessageBoxIntentHandler } from './message-box-intent-handler.service';
import { CoreModule } from '../core/core.module';
import { INTENT_HANDLER } from '../core/metadata';
import { NilQualifier } from '@scion/workbench-application-platform.api';

/**
 * Built-in capability to display a messagebox.
 */
@NgModule({
  imports: [
    CoreModule,
    WorkbenchModule.forChild(),
  ],
  providers: [
    {
      provide: INTENT_HANDLER,
      useFactory: provideDefaultMessageBoxIntentHandler,
      multi: true,
    },
  ],
})
export class MessageBoxCapabilityModule {
}

export function provideDefaultMessageBoxIntentHandler(): MessageBoxIntentHandler {
  return new MessageBoxIntentHandler(NilQualifier, 'Displays a messagebox to the user.');
}
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / manifest-capability / manifest-capability.module.ts View on Github external
*  SPDX-License-Identifier: EPL-2.0
 */

import { NgModule } from '@angular/core';
import { WorkbenchModule } from '@scion/workbench';
import { CoreModule } from '../core/core.module';
import { INTENT_HANDLER } from '../core/metadata';
import { ManifestRegistryIntentHandler } from './manifest-registry-intent-handler.service';

/**
 * Built-in capability to lookup manifests.
 */
@NgModule({
  imports: [
    CoreModule,
    WorkbenchModule.forChild(),
  ],
  providers: [
    {provide: INTENT_HANDLER, useClass: ManifestRegistryIntentHandler, multi: true},
  ],
})
export class ManifestCapabilityModule {
}
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / activity-capability / activity-capability.module.ts View on Github external
import { PopupOpenActivityActionComponent } from './popup-open-action/popup-open-activity-action.component';

/**
 * Built-in capability to allow applications to register activities.
 */
@NgModule({
  declarations: [
    ActivityOutletComponent,
    ViewOpenActivityActionComponent,
    PopupOpenActivityActionComponent,
    UrlOpenActivityActionComponent,
  ],
  imports: [
    CommonModule,
    CoreModule,
    WorkbenchModule.forChild(),
    RouterModule.forChild([]),
  ],
  providers: [
    {provide: ACTIVITY_ACTION_PROVIDER, useClass: ViewOpenActivityActionProvider, multi: true},
    {provide: ACTIVITY_ACTION_PROVIDER, useClass: PopupOpenActivityActionProvider, multi: true},
    {provide: ACTIVITY_ACTION_PROVIDER, useClass: UrlOpenActivityActionProvider, multi: true},
    {provide: APP_INITIALIZER, useFactory: provideModuleInitializerFn, multi: true, deps: [Injector]},
    ActivityRegistrator,
  ],
  entryComponents: [
    ActivityOutletComponent,
    ViewOpenActivityActionComponent,
    PopupOpenActivityActionComponent,
    UrlOpenActivityActionComponent,
  ],
})
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / workbench-application-platform.module.ts View on Github external
import { FORROOT_GUARD } from './workbench-application-platform.constants';
import { ErrorHandler, PlatformConfigLoader } from './core/metadata';
import { DefaultErrorHandler } from './core/default-error-handler.service';
import { CoreModule } from './core/core.module';
import { ViewCapabilityModule } from './view-capability/view-capability.module';
import { ActivityCapabilityModule } from './activity-capability/activity-capability.module';
import { MessageBoxCapabilityModule } from './messagebox-capability/message-box-capability.module';
import { NotificationCapabilityModule } from './notification-capability/notification-capability.module';
import { ManifestCapabilityModule } from './manifest-capability/manifest-capability.module';
import { PopupCapabilityModule } from './popup-capability/popup-capability.module';
import { ModulePlatformConfigLoader } from './core/module-platform-config-loader.service';
import { ActivatorCapabilityModule } from './activator-capability/activator-capability.module';

@NgModule({
  imports: [
    WorkbenchModule.forChild(),
    CoreModule,
    ViewCapabilityModule,
    ActivityCapabilityModule,
    MessageBoxCapabilityModule,
    NotificationCapabilityModule,
    PopupCapabilityModule,
    ManifestCapabilityModule,
    ActivatorCapabilityModule,
  ],
})
export class WorkbenchApplicationPlatformModule {

  constructor(@Inject(FORROOT_GUARD) guard: any) {
  }

  /**
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / notification-capability / notification-capability.module.ts View on Github external
*/

import { NgModule } from '@angular/core';
import { CoreModule } from '../core/core.module';
import { WorkbenchModule } from '@scion/workbench';
import { NotificationIntentHandler } from './notification-intent-handler.service';
import { INTENT_HANDLER } from '../core/metadata';
import { NilQualifier } from '@scion/workbench-application-platform.api';

/**
 * Built-in capability to show a notification.
 */
@NgModule({
  imports: [
    CoreModule,
    WorkbenchModule.forChild(),
  ],
  providers: [
    {
      provide: INTENT_HANDLER,
      useFactory: provideDefaultNotificationIntentHandler,
      multi: true,
    },
  ],
})
export class NotificationCapabilityModule {
}

export function provideDefaultNotificationIntentHandler(): NotificationIntentHandler {
  return new NotificationIntentHandler(NilQualifier, 'Shows a notification to the user.');
}

@scion/workbench

SCION Workbench enables the creation of Angular web applications that require a flexible layout to arrange content side-by-side or stacked, all personalizable by the user via drag & drop.

EPL-2.0
Latest version published 10 days ago

Package Health Score

84 / 100
Full package analysis