Created
March 11, 2014 01:38
-
-
Save slopeofhope81/9477929 to your computer and use it in GitHub Desktop.
my first clock watch app using angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var myApp = angular.module('myApp', []); | |
myApp.controller("myFirst", function($scope){ | |
$scope.clock = new Date(); | |
var updateClock = function(){ | |
$scope.clock = new Date(); | |
} | |
setInterval(function(){ | |
$scope.$apply(updateClock);}, 1000); | |
updateClock(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment