diff --git a/src/app/device-model/device-model-edit/device-model-edit.component.html b/src/app/device-model/device-model-edit/device-model-edit.component.html index 402127af..3b349ba1 100644 --- a/src/app/device-model/device-model-edit/device-model-edit.component.html +++ b/src/app/device-model/device-model-edit/device-model-edit.component.html @@ -10,7 +10,7 @@
- + *
* - - {{control}} @@ -81,13 +81,13 @@
* - - {{category}} @@ -98,14 +98,14 @@
- - {{unit.name}} @@ -116,13 +116,13 @@
- - {{function}} @@ -133,13 +133,13 @@
- - {{elclass.name}} @@ -150,13 +150,13 @@
- - {{protocol}} @@ -168,11 +168,11 @@
- \ No newline at end of file + diff --git a/src/app/device-model/device-model-table/device-model-table.component.ts b/src/app/device-model/device-model-table/device-model-table.component.ts index f997a1ef..e4f44bc2 100644 --- a/src/app/device-model/device-model-table/device-model-table.component.ts +++ b/src/app/device-model/device-model-table/device-model-table.component.ts @@ -65,10 +65,14 @@ export class DeviceModelTableComponent implements OnInit, AfterViewInit { // Flip flag to show that loading has finished. this.isLoadingResults = false; this.resultsLength = data.count; - - return data.data.sort((a, b) => - a.body.name.localeCompare(b.body.name, 'en', { numeric: true }) - ); + return data.data.sort((a, b) => { + if (a.body.name === undefined || b.body.name === undefined) { + return -1; + } + return a.body.name.localeCompare(b.body.name, 'en', { + numeric: true, + }); + }); }), catchError(() => { this.isLoadingResults = false;