Skip to content

Instantly share code, notes, and snippets.

@slopeofhope81
Created March 11, 2014 01:38
Show Gist options
  • Save slopeofhope81/9477929 to your computer and use it in GitHub Desktop.
Save slopeofhope81/9477929 to your computer and use it in GitHub Desktop.
my first clock watch app using angular
<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