2

I am having trouble with getting a formatter to work properly in rivets.

<span class='person-gender' rv-text='person:gender | gender'></span>

When I check the formatters declared on rivets with rivets.formatters, I see my formatter, but it is never applied.

Within Binding.prototype.formattedValue:398, I see:

else if (formatter instanceof Function) {
    value = formatter.apply(...)
}

But my formatter is not an instance of Function despite it being defined like so:

rivets.formatters.gender = function (value) {
    return value.charAt(0)
}

I am not sure why this formatter is not being applied. I declared it in the same place where I attached my backbone adapter. Any thoughts?

iggybbz
  • 63
  • 6
  • possible duplicate of [Iterate over a collection of Backbone.js models using Rivets.js?](http://stackoverflow.com/questions/11854126/iterate-over-a-collection-of-backbone-js-models-using-rivets-js) – Paul Sweatte Jan 26 '15 at 23:53
  • The question doesn't contain enough information to recreate the issue... Can you share the rest of code, for eg you implementation of `:` adapter ect or create a fiddle showing the problem..? – T J Oct 11 '15 at 19:14
  • It's been a year since I've used rivets so it's probably outdated now. – iggybbz Oct 12 '15 at 23:41

0 Answers0