{{! templates/view/view.component.ts.hbs }} import { Component, ChangeDetectionStrategy, } from '@angular/core'; import { getFieldNames, XExceptionIDs, isNullOrUndefined, isNullOrEmptyString, } from 'x-framework-core'; import { X__CLASS__Dto, default__CLASS__Dto, prepare__CLASS__DtoFields, } from 'x-saherelm-api-sdk'; import { VBaseDtoComponent, VModelFieldDescriptor, VModelValidationResult, } from '../../v-dto/v-dto.typings'; @Component({ selector: 'v-__NAME__', templateUrl: './v-__NAME__.component.html', styleUrls: ['./v-__NAME__.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class V__CLASS__Component extends VBaseDtoComponent { readonly defaultModel: X__CLASS__Dto = { ...default__CLASS__Dto }; readonly FieldNames = getFieldNames(this.defaultModel); defaultFieldDescriptors: VModelFieldDescriptor[] = [ // TODO: Add field descriptors ]; validate( model?: Partial ): VModelValidationResult { // TODO: Implement validation const normalized = this.normalize(model); return { isValid: true, normalized, isValidForAdd: true, isValidForUpdate: true, validationErrors: [], }; } prepare(model?: X__CLASS__Dto): X__CLASS__Dto { return prepare__CLASS__DtoFields(model); } }