has (attribute) Boolean
Checks if there is error messages for the given attribute.
app/routes/user/edit.js
1 2 3 4 5 6 7 8 9 10 11 12 | import 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.