Two-way data-binding is sooo 2009.
Hey, where did vehicle
come from in the last example?
Oh right, I told you we were going to talk about namespaces. Now you know.
The elaborate formula for your data attributes is: [namespace.]attribute
. The namespace part is optional but recommended.
How about some examples?
<!-- namespace: person, attribute: name -->
<input data-bound-to="person.name">
<!-- no namepsace, attribute: name -->
<input data-bound-to="name">
Make sense?
Namespaces are used not only in your binding attributes, but are also used when saving to LocalStorage, so it's a good idea to use them if you're planning on persisting your data to LocalStorage.
Tripod uses the same namespace.attribute
convention as the key for LocalStorage.