简体   繁体   中英

rivets.js is not working with handlebars template

I am using rivets.js for data binding in my backbone file. But i am using handlebar templates. so when i display my data in handlebars through rivets, it does not work. It works fine without handlebars.

in my javascript file:

var obj = {name: 'my name'}; rivets.bind($('#div1'), {'opp': obj});

in my handlebar file:

{{opp.name}}

Rivets and handlebars is not supposed to be used together. Rivets supports expressions in the form {} (by default) just like handlebars {{}} .

Rivets is expecting a "Rivets template", not handlebars template. And handlebars is expecting a handlebars template, not rivets template.

Either use rivets or use handlebars.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM