diff --git a/src/app/device-model/device-model-edit/device-model-edit.component.ts b/src/app/device-model/device-model-edit/device-model-edit.component.ts index a1e23526..ce0d3b0c 100644 --- a/src/app/device-model/device-model-edit/device-model-edit.component.ts +++ b/src/app/device-model/device-model-edit/device-model-edit.component.ts @@ -22,18 +22,18 @@ import { SupportedUnit } from '../supported-unit.model'; }) export class DeviceModelEditComponent implements OnInit { - public errorMessages: any; + public errorMessages: string[]; public errorFields: string[]; public deviceModel: DeviceModel = new DeviceModel(); public backButton: BackButton = { label: '', routerLink: '/device-model' }; public title = ''; public formFailedSubmit = false; - controlledPropperties = []; - categories = []; + controlledPropperties: ControlledPropperty[] = []; + categories: DeviceCategory[] = []; supportedUnits = new SupportedUnit(); - deviceFunctions = []; + deviceFunctions: DeviceFunction[] = []; energyLimitationClass = new EnergyLimitationClass(); - supportedProtocol = []; + supportedProtocol: SupportedProtocol[] = []; constructor( private translate: TranslateService, @@ -55,6 +55,8 @@ export class DeviceModelEditComponent implements OnInit { if (deviceModelId) { this.getDeviceModel(deviceModelId); } + this.supportedUnits.units.sort((a, b) => a.name.localeCompare(b.name)); + this.deviceFunctions.sort((a, b) => a.localeCompare(b)); } mapEnumsToArray() {