forked from gridstack/gridstack.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdummy.component.ts
34 lines (29 loc) · 979 Bytes
/
dummy.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* gridstack.component.ts 8.2.1
* Copyright (c) 2022 Alain Dumesny - see GridStack root license
*/
// dummy testing component that will be grid items content
import { Component, OnDestroy, Input } from '@angular/core';
import { BaseWidget, NgCompInputs } from 'gridstack/dist/angular';
@Component({
selector: 'app-a',
template: 'Comp A {{text}}',
})
export class AComponent extends BaseWidget implements OnDestroy {
@Input() text: string = 'foo'; // test custom input data
public override serialize(): NgCompInputs | undefined { return this.text ? {text: this.text} : undefined; }
ngOnDestroy() { console.log('Comp A destroyed'); } // test to make sure cleanup happens
}
@Component({
selector: 'app-b',
template: 'Comp B',
})
export class BComponent extends BaseWidget implements OnDestroy {
ngOnDestroy() { console.log('Comp B destroyed'); }
}
@Component({
selector: 'app-c',
template: 'Comp C',
})
export class CComponent extends BaseWidget {
}