瀏覽代碼

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 年之前
父節點
當前提交
7a576b6b1f
共有 1 個文件被更改,包括 9 次插入0 次删除
  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;