I'm currently working with KnockoutJS version 3.4.
In TypeScript, my view model is structured as follows:
export class ItemsViewModel {
public currentItem: KnockoutObservable<ItemViewModel>;
public items: KnockoutObservableArray<KnockoutObservable<ItemViewModel>>;
/* snip */
}
The ItemViewModel
object consists of multiple observable properties such as Id
, Name
, and Description
.
I am looking to subscribe to specific property changes within the currentItem
. Using currentItem.subscribe
allows me to monitor changes in the overall value of the currentItem
observable, but I need a way to identify when individual properties are modified within that item. The other question referenced as a duplicate only tracks changes at the object level, whereas I require detection at the property level.
What would be the most efficient approach to achieve this?
Edit: Taking into account the feedback and associated question, it does not provide details on which property was altered. Therefore, I have made amendments to clarify this inquiry.