Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map to a valueless attribute #128

Open
jsncrdnl opened this issue Aug 14, 2015 · 0 comments
Open

Map to a valueless attribute #128

jsncrdnl opened this issue Aug 14, 2015 · 0 comments

Comments

@jsncrdnl
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant