Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outputting a class with Rivets.js?

I thought this would be easier unless I'm missing something but I can't figure out how to output a piece of my data as a class.

<div class="partner-type" rv-class="partner.partner-type"></div>

doesn't work. It should say the value in that property "technology" or "service". Is there anyway to do string interpolation or something? Data attrs?

like image 814
danhere Avatar asked Apr 07 '15 20:04

danhere


1 Answers

I ended up using something like

rv-class-ineededthisclass="partner.partner_type | isNotEqual 'premier'"

Btw, this library is great for rivetsjs: https://github.com/matthieuriolo/rivetsjs-stdlib

like image 73
danhere Avatar answered Oct 08 '22 21:10

danhere