Skip to content

Commit 423657e

Browse files
committed
v1.2.1
1 parent 69838cb commit 423657e

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Diff for: bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Siddique Hameed",
33
"name": "angular-timer",
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"homepage": "https://github.com/siddii/angular-timer",
66
"description": "Angular-Timer : A simple AngularJS directive demonstrating re-usability & interoperability",
77
"repository": {

Diff for: dist/angular-timer.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* angular-timer - v1.2.0 - 2014-12-15 6:34 PM
2+
* angular-timer - v1.2.1 - 2015-02-25 4:19 PM
33
* https://github.com/siddii/angular-timer
44
*
5-
* Copyright (c) 2014 Siddique Hameed
5+
* Copyright (c) 2015 Siddique Hameed
66
* Licensed MIT <https://github.com/siddii/angular-timer/blob/master/LICENSE.txt>
77
*/
88
var timerModule = angular.module('timer', [])
@@ -19,7 +19,7 @@ var timerModule = angular.module('timer', [])
1919
autoStart: '&autoStart',
2020
maxTimeUnit: '='
2121
},
22-
controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {
22+
controller: ['$scope', '$element', '$attrs', '$timeout', '$interpolate', function ($scope, $element, $attrs, $timeout, $interpolate) {
2323

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

3737
if ($element.html().trim().length === 0) {
38-
$element.append($compile('<span>{{millis}}</span>')($scope));
38+
$element.append($compile('<span>' + $interpolate.startSymbol() + 'millis' + $interpolate.endSymbol() + '</span>')($scope));
3939
} else {
4040
$element.append($compile($element.contents())($scope));
4141
}
@@ -76,6 +76,12 @@ var timerModule = angular.module('timer', [])
7676
}
7777
}
7878

79+
$scope.$watch('startTimeAttr', function(newValue, oldValue) {
80+
if (newValue !== oldValue && $scope.isRunning) {
81+
$scope.start();
82+
}
83+
});
84+
7985
$scope.start = $element[0].start = function () {
8086
$scope.startTime = $scope.startTimeAttr ? new Date($scope.startTimeAttr) : new Date();
8187
$scope.endTime = $scope.endTimeAttr ? new Date($scope.endTimeAttr) : null;

Diff for: dist/angular-timer.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Siddique Hameed",
33
"name": "angular-timer",
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"homepage": "https://github.com/siddii/angular-timer",
66
"main":"dist/angular-timer.js",
77
"licenses": {

0 commit comments

Comments
 (0)