has (attribute) Boolean
Checks if there is error messages for the given attribute.
app/routes/user/edit.jsimport Ember from 'ember';
export default Ember.Route.extend({
actions: {
save: function(user) {
if (user.get('errors').has('email')) {
return alert('Please update your email before attempting to save.');
}
user.save();
}
}
});
Parameters:
-
attribute
String
Returns:
-
Boolean - true if there some errors on given attribute
Please login to continue.