From 212a0105c32fc3161a256156a58514cf1e61d957 Mon Sep 17 00:00:00 2001 From: Todd Motto Date: Wed, 19 Apr 2017 23:18:04 +0100 Subject: [PATCH] fix(ngxerror.directive): Array.includes not support in IE, switch to indexOf --- src/ngxerror.directive.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ngxerror.directive.ts b/src/ngxerror.directive.ts index 7c73419..a5e77b7 100755 --- a/src/ngxerror.directive.ts +++ b/src/ngxerror.directive.ts @@ -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]) => {