Skip to content

Commit 70ed267

Browse files
committed
Add adaptive interpolation symbol
1 parent 3259fae commit 70ed267

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/js/timer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var timerModule = angular.module('timer', [])
1212
autoStart: '&autoStart',
1313
maxTimeUnit: '='
1414
},
15-
controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {
15+
controller: ['$scope', '$element', '$attrs', '$timeout', '$interpolate', function ($scope, $element, $attrs, $timeout, $interpolate) {
1616

1717
// Checking for trim function since IE8 doesn't have it
1818
// If not a function, create tirm with RegEx to mimic native trim
@@ -28,7 +28,7 @@ var timerModule = angular.module('timer', [])
2828
$scope.autoStart = $attrs.autoStart || $attrs.autostart;
2929

3030
if ($element.html().trim().length === 0) {
31-
$element.append($compile('<span>{{millis}}</span>')($scope));
31+
$element.append($compile('<span>' + $interpolate.startSymbol() + 'millis' + $interpolate.endSymbol() + '</span>')($scope));
3232
} else {
3333
$element.append($compile($element.contents())($scope));
3434
}

0 commit comments

Comments
 (0)