Open anvial opened 7 years ago
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.
Hi,
Do you have the same problem with the demo app ?? Would be nice to be able to reproduce it on it. Will be easier to understand what's going on
Hello,
I use standard widget component template. See next:
The problem is when I'm adding this widget to dashboard – the ngOnInit() method called twice.
Any suggestions? Thank You.