When retrieving data from a model whats the difference between using "viewModel.attr" and "viewModel.get('attr')" ?
Both return the same object.
Thanks,
Grant
1 Answer, 1 is accepted
0
Accepted
Tsvetina
Telerik team
answered on 04 Oct 2017, 10:21 AM
Hello Grant,
If you use viewModel.attr to access a value in a function inside the viewModel, on change of the attr value within the model, your function will not be re-evaluated.
When a view model function accesses a value using the get() method, it gets notified on each value change and the function logic is re-evaluated (see dependent methods). If you use dot notation to access a value, you just get the current property value at the time of execution of this line of code.
Additional information about the ObservableObject (view model) in Kendo MVVM is available here.