Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Plates = require('plates');
- // This works:
- var html = '<a class="ticket-search-title" href="foo">title</a></td><td>';
- data = { 'url': 'http://github.com', 'title': 'Github' };
- map = Plates.Map();
- map.class('ticket-search-title').use('title');
- map.class('ticket-search-title').use('url').as('href');
- console.log(Plates.bind(html, data, map));
- // This doesn't:
- var html = '<a class="ticket-search-title" href="foo">title</a></td><td>';
- data = { 'url': 'http://github.com', 'title': 'Github' };
- map = Plates.Map();
- map.class('ticket-search-title').use('url').as('href');
- map.class('ticket-search-title').use('title');
- // console.log(data);
- console.log(Plates.bind(html, data, map));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement