|
|
|
|
|
by TekMol
3277 days ago
|
|
you could do it automatically by assuming that some
attribute like `data-bind` corresponds to a binding
Yes, that could be done. That would mean to extend Simulacra. Or do it outside of it.To me personally, <div>{{NAME}}</div> is easier to read and reason about. Also, it enables you to do stuff like <div>{{CITY}} has {{POPULATION}} residents</div>
Which is much shorter then <div><span data-bind="city"></span> has <span data-bind="population"></span> residents</div>
You can also do other useful stuff. For example: <div class="{{STATUS}}">{{MACHINE}}</div>
And then style different statuses via CSS. |
|
The reason is that every templating language I've used either is or becomes a Turing-complete language by itself.