فهرست منبع

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;