Imagine a scenario where you have two fields defined within a class:
export class SomeClass {
selectedObjects: MyClass[];
fieldToUpdateWhenArrayAboveChange:string;
}
Given the example above, the goal is to automatically update the second field with a comma-separated list of values from the first field (the array).
The 'selectedObjects' field is connected to the UI via 'ngModel'.
Is there a way to execute custom code when a field changes in Angular 2? In C# classes, this can be easily achieved using setters.