Advertisement
Guest User

Untitled

a guest
Aug 17th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Plates = require('plates');
  2.  
  3. // This works:
  4. var html = '<a class="ticket-search-title" href="foo">title</a></td><td>';
  5. data = { 'url': 'http://github.com', 'title': 'Github' };
  6. map = Plates.Map();
  7. map.class('ticket-search-title').use('title');
  8. map.class('ticket-search-title').use('url').as('href');
  9. console.log(Plates.bind(html, data, map));
  10.  
  11. // This doesn't:
  12. var html = '<a class="ticket-search-title" href="foo">title</a></td><td>';
  13. data = { 'url': 'http://github.com', 'title': 'Github' };
  14. map = Plates.Map();
  15. map.class('ticket-search-title').use('url').as('href');
  16. map.class('ticket-search-title').use('title');
  17. // console.log(data);
  18. console.log(Plates.bind(html, data, map));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement