remove (attribute) deprecated
Removes all error messages from the given attribute and sends becameValid
event to the record if there no more errors left.
Example:
app/models/user.js
import DS from 'ember-data'; export default DS.Model.extend({ email: DS.attr('string'), twoFactorAuth: DS.attr('boolean'), phone: DS.attr('string') });
app/routes/user/edit.js
import Ember from 'ember'; export default Ember.Route.extend({ actions: { save: function(user) { if (!user.get('twoFactorAuth')) { user.get('errors').remove('phone'); } user.save(); } } });
Parameters:
-
attribute
String
Please login to continue.