Browse Source

Merge pull request #520 from jalbr74/master

Fixed a bug in textAngular, making calls to an angular API that's been removed
Jason Rivard 5 years ago
parent
commit
7a576b6b1f
1 changed files with 9 additions and 0 deletions
  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';
 import 'textangular/dist/textAngular-sanitize';
 import 'textangular/dist/textAngular-sanitize';
+import * as angular from 'angular';
 
 
 import { module } from 'angular';
 import { module } from 'angular';
 
 
@@ -27,3 +28,11 @@ import ConfigEditorController from './configeditor.controller';
 
 
 module('configeditor.module', ['textAngular'])
 module('configeditor.module', ['textAngular'])
     .controller('ConfigEditorController', ConfigEditorController);
     .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;