Skip to content

Commit 69838cb

Browse files
committed
Merge pull request #153 from iblis17/master
Add adaptive interpolation symbol
2 parents 3259fae + 80734f4 commit 69838cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
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
}

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ <h3>
111111

112112
<div class="bs-docs-example">
113113
<p>
114-
Following is the countdown timer setting for the days, hours, minutes & seconds to <b>January 1, 2015 (GMT-6) </b>
115-
<p class="muted">(01 Jan 2015 06:00:00 GMT = 1420070400000 milliseconds)</p>
116-
<code ng-non-bindable="">&lt;timer end-time=&quot;1420070400000&quot;&gt;{{days}} days, {{hours}} hours, {{minutes}} minutes, {{seconds}} seconds.&lt;/timer&gt;</code>
114+
Following is the countdown timer setting for the days, hours, minutes & seconds to <b>January 1, 2016 (GMT-6) </b>
115+
<p class="muted">(01 Jan 2016 06:00:00 GMT = 1451628000000 milliseconds)</p>
116+
<code ng-non-bindable="">&lt;timer end-time=&quot;1451628000000&quot;&gt;{{days}} days, {{hours}} hours, {{minutes}} minutes, {{seconds}} seconds.&lt;/timer&gt;</code>
117117
<h3>
118-
<timer end-time="1420070400000">{{days}} days, {{hours}} hours, {{minutes}} minutes, {{seconds}} seconds.</timer>
118+
<timer end-time="1451628000000">{{days}} days, {{hours}} hours, {{minutes}} minutes, {{seconds}} seconds.</timer>
119119
</h3>
120120
</div>
121121
</section>

0 commit comments

Comments
 (0)