agility
agility copied to clipboard
Allow definition of nested model relationships with dotted notation
Allow definition of nested model relationships with dotted notation:
obj.model.set({person:{name:'John Doe'}}) can now be addressed with 'person.name' in data bindings as well as obj.model.get('person.name')
Events are also specified with dotted notation 'change:person.name':function(){}
This looks good to me, really like those tests. @tristanls ?
Made a note on code and I'm rusty getting back to ui development, but taking a quick look nothing breaking jumped out.
What about 'person.addresses.0.street', 'person.addresses.1.street' ? Or better 'person.addresses[0].street' ? Maybe something like this too : this.model.get('person.addresses.$.street'), to get all streets for example ? This can be useful as well, what do you think ?
PS: I'm just starting with Agilityjs. I've tested Backbonejs, Knockoutjs, Angularjs, Emberjs, but Agilityjs is the one that fits my way of programming the best. It's really a clever piece of code, thanks Artur. I hope that you will find more time to take care of it.