Created
September 3, 2014 13:40
-
-
Save rohozhnikoff/838b0d824c86ef501047 to your computer and use it in GitHub Desktop.
block helper to check if arguments is equal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`import Em from 'ember'` | |
equal = (args..., options) -> | |
arr = for arg in args | |
value = @get(arg) | |
if typeof value isnt 'undefined' then value else arg | |
method = if _.isEqual.apply(_, arr) then 'fn' else 'inverse' | |
return options[method](@) | |
EqualHelper = Em.Handlebars.registerHelper 'equal', equal | |
`export { equal }` | |
`export default EqualHelper` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment