Skip to content

Commit

Permalink
fix(ngxerror.directive): Array.includes not support in IE, switch to …
Browse files Browse the repository at this point in the history
…indexOf
  • Loading branch information
toddmotto committed Apr 19, 2017
1 parent d2cbf72 commit 212a010
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ngxerror.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export class NgxErrorDirective implements OnInit, OnDestroy, DoCheck {

const errors = this.ngxErrors.subject
.filter(Boolean)
.filter(obj => this.errorNames.includes(obj.errorName));
.filter(obj => !!~this.errorNames.indexOf(obj.errorName));

const states = this.states
.map(states => this.rules.every(rule => states.includes(rule)));
.map(states => this.rules.every(rule => !!~states.indexOf(rule)));

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

0 comments on commit 212a010

Please sign in to comment.