Browse Source

Fixed an error in textAngular, making calls to an API that's been removed

textAngular-sanitize.js:416 Uncaught TypeError: e.lowercase is not a function
    at T (textAngular-sanitize.js:416)
    at textAngular-sanitize.js:381
    at textAngular-sanitize.js:150
    at textAngular.umd.js:462
    at Object.invoke (angular.js:5143)
    at angular.js:4942
    at S (angular.js:387)
    at Qe (angular.js:4942)
    at i (angular.js:1962)
    at kt (angular.js:1983)
James Albright 5 năm trước cách đây
mục cha
commit
06aa4a6e4f
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      client/src/modules/configeditor/configeditor.module.ts

+ 9 - 0
client/src/modules/configeditor/configeditor.module.ts

@@ -20,6 +20,7 @@
 
 import 'textangular';
 import 'textangular/dist/textAngular-sanitize';
+import * as angular from 'angular';
 
 import { module } from 'angular';
 
@@ -27,3 +28,11 @@ import ConfigEditorController from './configeditor.controller';
 
 module('configeditor.module', ['textAngular'])
     .controller('ConfigEditorController', ConfigEditorController);
+
+// lowercase and uppercase have been removed from angular, but textAngular still hasn't caught up with the change. So
+// The following polyfills it for now:
+
+// @ts-ignore
+if (!angular.lowercase) angular.lowercase = (str) => str ? str.toLowerCase() : str;
+// @ts-ignore
+if (!angular.uppercase) angular.uppercase = (str) => str ? str.toUpperCase() : str;