thingsboard-aplcache

IE fix: String.includes polyfill

2/1/2019 11:18:20 AM

Changes

Details

diff --git a/ui/src/app/ie.support.js b/ui/src/app/ie.support.js
index 7f78459..52b3329 100644
--- a/ui/src/app/ie.support.js
+++ b/ui/src/app/ie.support.js
@@ -53,6 +53,19 @@
             return result;
         };
     }
+    if (!String.prototype.includes) {
+        String.prototype.includes = function(search, start) {
+            if (angular.isNumber(start)) {
+                start = 0;
+            }
+
+            if (start + search.length > this.length) {
+                return false;
+            } else {
+                return this.indexOf(search, start) !== -1;
+            }
+        };
+    }
 
     (function (arr) {
         arr.forEach(function (item) {