Last active
August 29, 2015 14:25
-
-
Save alexparker/f5cc2947c2303f54d32e to your computer and use it in GitHub Desktop.
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
model.eachAttribute(function(name, meta) { | |
var methodName = name + "Valid"; | |
var errorsKey = "errors." + name; | |
var method = function() { | |
var isValid = Ember.isEmpty(this.get(errorsKey)); | |
if (isValid) { | |
return 'valid'; | |
} else { | |
return 'input--error'; | |
} | |
}.property(errorsKey) | |
_this.set(methodName, method); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment