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));
NOTE: I added extra spaces around my html "p" tag to avoid my code being formated by github
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));