Browse Source

Merge branch 'feature/lwm2m-refactoring-downlink' of github.com:thingsboard/thingsboard into feature/lwm2m-refactoring-downlink

pull/4760/head
Andrii Shvaika 5 years ago
parent
commit
b32bd4ec44
  1. 13
      ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-object-list.component.ts

13
ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-object-list.component.ts

@ -89,6 +89,13 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V
objectsList: [this.objectsList],
objectLwm2m: ['']
});
this.lwm2mListFormGroup.valueChanges.subscribe((value) => {
let formValue = null;
if (this.lwm2mListFormGroup.valid) {
formValue = value;
}
this.propagateChange(formValue);
});
}
private updateValidators = (): void => {
@ -142,7 +149,7 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V
this.objectsList = [];
this.modelValue = [];
}
this.lwm2mListFormGroup.get('objectsList').setValue(this.objectsList, {emitEvents: false});
this.lwm2mListFormGroup.patchValue({objectsList: this.objectsList}, {emitEvent: false});
this.dirty = false;
}
}
@ -195,9 +202,9 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V
}
}
private clear = (): void => {
private clear() {
this.searchText = '';
this.lwm2mListFormGroup.get('objectLwm2m').patchValue(null);
this.lwm2mListFormGroup.get('objectLwm2m').patchValue(null, {emitEvent: false});
setTimeout(() => {
this.objectInput.nativeElement.blur();
this.objectInput.nativeElement.focus();

Loading…
Cancel
Save