Skip to content

Commit 66c8728

Browse files
committed
refactor computed property to native getter with compatibility layer
1 parent 47a7fe0 commit 66c8728

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

addon/components/bs-form/element.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import BsFormElement from 'ember-bootstrap/components/bs-form/element';
2+
import { dependentKeyCompat } from '@ember/object/compat';
23

34
export default class BsFormElementWithChangesetValidationsSupport extends BsFormElement {
45
'__ember-bootstrap_subclass' = true;
56

7+
@dependentKeyCompat
68
get errors() {
7-
return [
8-
this.model.error[this.property]?.validation
9-
];
9+
let error = this.model.error[this.property]?.validation;
10+
return error ? [error] : [];
1011
}
1112

1213
get hasValidator() {

0 commit comments

Comments
 (0)