If it returns true, it means all pending initializations have finished
Returns true if all validations didn't return any error. All validations are decorated with @Validate decorator.
Returns parent AtomViewModel if it was initialized with one. This property is also useful when you open an popup or window. Whenever a popup/window is opened, ViewModel associated with the UI element that opened this popup/window becomes parent of ViewModel of popup/window.
Returns parent AtomViewModel if it was initialized with one. This property is also useful when you open an popup or window. Whenever a popup/window is opened, ViewModel associated with the UI element that opened this popup/window becomes parent of ViewModel of popup/window.
dispose method will be called when attached view will be disposed or when a new view model will be assigned to view, old view model will be disposed.
Put your asynchronous initialization here
Refreshes bindings associated with given property name
name of property
Register a disposable to be disposed when view model will be disposed.
Resets validations and all errors are removed.
reset child view models as well. Default is true.
Runs function after initialization is complete.
function to execute
Execute given expression whenever any bindable expression changes in the expression.
For correct generic type resolution, target must always be this
.
this.setupWatch(() => {
if(!this.data.fullName){
this.data.fullName = `${this.data.firstName} ${this.data.lastName}`;
}
});
Generated using TypeDoc
ViewModel class supports initialization and supports IDisposable dispose pattern.
AtomViewModel