This question is related to Ember Octane How to Get Error Messages to be Displayed?
Question: What is the correct way to clear form errors and how do I do it?
In Ember Classic, I am able to clear form errors within the component JS file using the following code snippet:
Import { A } from '@ember/array';
...
init() {
this._super(... arguments);
this.set('errors', A([]));
},
However, in Ember Octane, I get the following ESLint error:
Don't use
this._super
in ES classes ember/no-ember-super-in-es-classes
I tried changing the code snippet to:
Import { A } from '@ember/array';
...
init() {
super(... arguments);
this.set('errors', A([]));
}
Unfortunately, I get the following error:
super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?
Aucun commentaire:
Enregistrer un commentaire