mardi 6 mai 2014

ViewModel config

Considering the following fiddle: http://ift.tt/1kSBJ9l

I'm trying really hard to wrap my head around this ViewModel thing.


In the situations where I don't need any actual logic in the ViewModel I find it unecessary to define an actual viewmodel for the particular view.


The docs states that the default is {lazy: true, $value: null} - but it complains about missing viewmodels unless I set viewmodel to one of the values in the fiddle.


I mean... "viewModel: 1354657364253142" actually works... what the hell kind of validation is this?


And if the view really needs a viewmodel, then why is it working perfectly and as intended when viewmodel can be anything (note the tree.Panel) except undefined or false.


Am I missing something?





Aucun commentaire:

Enregistrer un commentaire