0

I have a form inside a modal, that form allows user to update each model feild and I'm also using ember-validations to validate them, but then after successful saving or when a user closes/cancel the modal the form element still contain the class has-success, has-error, has-feedback classes, so how can I reset the form fields after every successful saving/cancel?

4

1 回答 1

0

通常的做法是创建新的 Form 实例而不是清除错误。对于每个打开表单/模式,您应该创建新表单

  form: computed(function() {
    return Form.create({    });
  }),
  actions: {
     onShow() {
       this.notifyPropertyChange('form');
     }
  }
于 2016-03-18T08:31:46.733 回答