08b5320f by Michael Richards

First check if the formatter is defined on the model, then fallback to the globa…

…l formatter if it exists.
1 parent d3f10ab6
...@@ -32,10 +32,10 @@ class Rivets.Binding ...@@ -32,10 +32,10 @@ class Rivets.Binding
32 for formatter in @formatters 32 for formatter in @formatters
33 args = formatter.split /\s+/ 33 args = formatter.split /\s+/
34 id = args.shift() 34 id = args.shift()
35 value = if Rivets.config.formatters[id] 35 value = if @model[id] instanceof Function
36 Rivets.config.formatters[id] value, args...
37 else
38 @model[id] value, args... 36 @model[id] value, args...
37 else if Rivets.config.formatters[id]
38 Rivets.config.formatters[id] value, args...
39 39
40 value 40 value
41 41
......