// Angular imports // import { OnInit, Input } from '@angular/core'; // Components // // Interfaces // // Services // // Directives // // Other classes // import { FbFormBase } from './fbFormBase'; // import { Guid } from '@fb/static/Guid'; export class FbFormWithOptionsBase extends FbFormBase implements OnInit { @Input() options: any[]; @Input() showAttr: string; @Input() valueAttr: string; constructor() { super(); } ngOnInit(): void { super.ngOnInit(); this.checkOptionsAttributesBeforeInit(); } private checkOptionsAttributesBeforeInit(): void { let errorString: string = ''; // Kontrollera att nödvändiga attribut för dropdown är satta if (typeof this.showAttr === 'undefined') { errorString += 'Missing required parameter: showAttr \n'; } if (typeof this.valueAttr === 'undefined') { errorString += 'Missing required parameter: valueAttr \n'; } if (typeof this.options === 'undefined') { errorString += 'Missing required parameter: options \n'; } if (errorString !== '') { errorString = this.getStringFromModel() + '. ' + errorString; throw new Error(errorString); } } }