Skip to content

Commit 212a010

Browse files
committed
fix(ngxerror.directive): Array.includes not support in IE, switch to indexOf
1 parent d2cbf72 commit 212a010

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ngxerror.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export class NgxErrorDirective implements OnInit, OnDestroy, DoCheck {
5151

5252
const errors = this.ngxErrors.subject
5353
.filter(Boolean)
54-
.filter(obj => this.errorNames.includes(obj.errorName));
54+
.filter(obj => !!~this.errorNames.indexOf(obj.errorName));
5555

5656
const states = this.states
57-
.map(states => this.rules.every(rule => states.includes(rule)));
57+
.map(states => this.rules.every(rule => !!~states.indexOf(rule)));
5858

5959
this.subscription = Observable.combineLatest(states, errors)
6060
.subscribe(([states, errors]) => {

0 commit comments

Comments
 (0)