UNPKG

1.82 kBPlain TextView Raw
1import { NgModule } from '@angular/core';
2import { WidgetDemo } from './demo-widget.component';
3import { WidgetConfigDemo } from './demo-widget-config.component';
4import { FormsModule, CommonModule as C8yCommonModule, hookComponent } from '@c8y/ngx-components';
5import { ContextWidgetConfig } from '@c8y/ngx-components/context-dashboard';
6import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
7
8/**
9 * This demo widget provides an example on how
10 * to use the hookComponent. The component itself
11 * is implemented in the dashboard on the
12 * ../hello/hello.component.html by using the
13 * dynamic-component tag.
14 */
15@NgModule({
16 declarations: [WidgetDemo, WidgetConfigDemo],
17 imports: [FormsModule, AssetSelectorModule, C8yCommonModule],
18 exports: [],
19 providers: [
20 hookComponent({
21 id: 'angular.widget.demo',
22 label: 'My angular widget',
23 description: 'This is a description from angular',
24 component: WidgetDemo,
25 configComponent: WidgetConfigDemo,
26
27 /** new Angular-Dashboard definition */
28 data: {
29 // The settings object can be used to configure the configComponent
30 settings: {
31 noNewWidgets: false, // Set this to true, to don't allow adding new widgets.
32 ng1: {
33 options: {
34 noDeviceTarget: false, // Set this to true to hide the AngularJS device selector.
35 groupsSelectable: false // Set this, if not only devices should be selectable.
36 }
37 }
38 },
39 // Settings that are attached to the display component (in this case: WidgetDemo)
40 displaySettings: {
41 globalTimeContext: true // Set this to true, to add a global time context binding
42 }
43 } as ContextWidgetConfig
44 })
45 ]
46})
47export class DashboardWidgetDemoModule {}