@c8y/apps
Version:
Cumulocity IoT applications
35 lines (31 loc) • 942 B
text/typescript
import { Component, Input } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';
import { DynamicComponent, OnBeforeSave, AlertService } from '@c8y/ngx-components';
export class WidgetPluginConfig implements DynamicComponent, OnBeforeSave {
config: any = {};
constructor(private alert: AlertService) {}
onBeforeSave(config: any): boolean {
if (config.text.trim() === '') {
this.alert.warning('Please enter a valid text.');
return false;
}
return true;
}
}