|
|
|
|
|
by daliwali
3275 days ago
|
|
I'm not sure I understand what you mean by additional mapping. Here's all that's needed in the template: <div class="city"><span class="name"></span> has <span class="population"></span> residents</div>
And the mapping would be: [ 'city': [ '.city', { name: '.name', population: '.population' } ] ]
If you don't want to manually define a mapping, you could do it automatically by assuming that some attribute like `data-bind` corresponds to a binding, but Simulacra.js doesn't make assumptions like that. |
|
To me personally, <div>{{NAME}}</div> is easier to read and reason about. Also, it enables you to do stuff like
Which is much shorter then You can also do other useful stuff. For example: And then style different statuses via CSS.