First check if the formatter is defined on the model, then fallback to the globa…
…l formatter if it exists.
Showing
1 changed file
with
3 additions
and
3 deletions
... | @@ -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 | ... | ... |
-
Please register or sign in to post a comment