Open
Description
Hello,
I use standard widget component template. See next:
@Component({
selector: 'line-widget',
templateUrl: './line-widget.component.html',
styleUrls: ['./line-widget.component.css'],
providers: [{provide: WidgetComponent, useExisting: forwardReference}]
})
export class LineWidgetComponent extends WidgetComponent implements OnInit {
@ViewChild(WidgetHandleDirective) protected _handle: WidgetHandleDirective;
@Input() public size: number[] = [2, 2];
@Input() public widgetId: string;
@Output() onClose = new EventEmitter<any>();
// somecode
constructor(
ngEl: ElementRef,
renderer: Renderer2
) {
super(ngEl, renderer);
}
ngOnInit() {
super.ngOnInit();
console.warn('line chart');
}
closeWidget() {
this.onClose.emit(this.widgetId);
}
}
The problem is when I'm adding this widget to dashboard – the ngOnInit() method called twice.
Any suggestions?
Thank You.
Metadata
Metadata
Assignees
Labels
No labels