From 60c059a77f1d7b34229260967cf48b9652b36de8 Mon Sep 17 00:00:00 2001 From: Aldarund Date: Wed, 15 Apr 2015 12:43:50 +0300 Subject: [PATCH 1/2] use of $interpolate.startSymbol() and $interpolate.endSymbol() to support custom start and end symbols --- dist/angular-busy.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/angular-busy.js b/dist/angular-busy.js index 31c8952..b08220b 100644 --- a/dist/angular-busy.js +++ b/dist/angular-busy.js @@ -118,8 +118,8 @@ angular.module('cgBusy').factory('_cgBusyTrackerFactory',['$timeout','$q',functi angular.module('cgBusy').value('cgBusyDefaults',{}); -angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusyDefaults','$http','_cgBusyTrackerFactory', - function($compile,$templateCache,cgBusyDefaults,$http,_cgBusyTrackerFactory){ +angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusyDefaults','$http','_cgBusyTrackerFactory','$interpolate', + function($compile,$templateCache,cgBusyDefaults,$http,_cgBusyTrackerFactory,$interpolate){ return { restrict: 'A', link: function(scope, element, attrs, fn) { @@ -221,6 +221,16 @@ angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusy } var template = '
' + indicatorTemplate + '
'; + + var startSym = $interpolate.startSymbol(), + endSym = $interpolate.endSymbol(); + + // If either of the interpolation symbols have been changed, we need to alter this template + if (startSym !== '{{' || endSym !== '}}') { + template = template.replace(/\{\{/g, startSym); + template = template.replace(/\}\}/g, endSym); + } + templateElement = $compile(template)(templateScope); angular.element(templateElement.children()[0]) From fe4c83c256975b1e8bb722e00c1437bda1c4d1a9 Mon Sep 17 00:00:00 2001 From: Aldarund Date: Wed, 15 Apr 2015 12:44:48 +0300 Subject: [PATCH 2/2] use of $interpolate.startSymbol() and $interpolate.endSymbol() to support custom start and end symbols --- angular-busy.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/angular-busy.js b/angular-busy.js index 557435c..a5e38d7 100755 --- a/angular-busy.js +++ b/angular-busy.js @@ -118,8 +118,8 @@ angular.module('cgBusy').factory('_cgBusyTrackerFactory',['$timeout','$q',functi angular.module('cgBusy').value('cgBusyDefaults',{}); -angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusyDefaults','$http','_cgBusyTrackerFactory', - function($compile,$templateCache,cgBusyDefaults,$http,_cgBusyTrackerFactory){ +angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusyDefaults','$http','_cgBusyTrackerFactory','$interpolate', + function($compile,$templateCache,cgBusyDefaults,$http,_cgBusyTrackerFactory,$interpolate){ return { restrict: 'A', link: function(scope, element, attrs, fn) { @@ -221,6 +221,16 @@ angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusy } var template = '
' + indicatorTemplate + '
'; + + var startSym = $interpolate.startSymbol(), + endSym = $interpolate.endSymbol(); + + // If either of the interpolation symbols have been changed, we need to alter this template + if (startSym !== '{{' || endSym !== '}}') { + template = template.replace(/\{\{/g, startSym); + template = template.replace(/\}\}/g, endSym); + } + templateElement = $compile(template)(templateScope); angular.element(templateElement.children()[0])