|
|
|
|
|
by TekMol
3274 days ago
|
|
this is exactly how CSS works as well
I beg to differ. There is no mapping needed for CSS. CSS works by once defining where the style shall go: <div class=city></div>
And once what the style is: .city {color: blue; font-family: arial;}
Similar, template syntax once defines where the data shall go: <div class=city>{{NAME}} has {{POPULATION}} residents</div>
And once, what the data is: city={name: "New York", population: 8491000}
Neither need additional mapping. |
|
Here's all that's needed in the template:
And the mapping would be: 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.