flatiron / plates

Light-weight, logic-less, DSL-free, templates for all javascript environments!
MIT License
831 stars 69 forks source link

Map to a valueless attribute #128

Open jsncrdnl opened 9 years ago

jsncrdnl commented 9 years ago

The mapping to a custom html tag is great but I'd need to map to an html attribute which doesn't take a value. Would it be possible to implement this ?

This actually works: var Plates = require("plates"); var html = "< p my-content='changeable'>This should be erased...</ p >"; var data = { 'content': "It is: -> "+new Date() }; var map = Plates.Map(); map.where('my-content').is("changeable").use('content'); console.log(Plates.bind(html, data, map));

But I'd like that code to work in this case: var Plates = require("plates"); var html = "< p my-content>This should be erased...</ p >"; var data = { 'content': "It is: -> "+new Date() }; var map = Plates.Map(); map.where('my-content').use('content'); console.log(Plates.bind(html, data, map));