Working with arrays
In order to know when items change in array you can subscribe to events. Array prop builder supports following observables:
onItemAdd
- called when new item is added.onItemRemove
- called when item is removed.onItemsSet
- called whensetValue
orsetJsonValue
is called.
Example usage from core table layout
this.propBuilder.onItemsSet
.pipe(takeUntil(this.ngUnsubscribe))
.subscribe(() => {
this.detectChanges();
});
this.propBuilder.onItemAdd
.pipe(takeUntil(this.ngUnsubscribe))
.subscribe(() => {
this.detectChanges();
});
this.propBuilder.onItemRemove
.pipe(takeUntil(this.ngUnsubscribe))
.subscribe(() => {
this.detectChanges();
});
Last updated
Was this helpful?