Created
September 16, 2017 16:19
-
-
Save kuzmicheff/160cfef7c42145b9464867469dedb3f5 to your computer and use it in GitHub Desktop.
Simple clock in AngularJS
This file contains 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
var app = angular.module("myApp", []); | |
app.controller("myCtrl", function($scope, $interval) { | |
$scope.theTime = new Date().toLocaleTimeString(); | |
$interval(function() { | |
$scope.theTime = new Date().toLocaleTimeString(); | |
}, 1000); | |
}); |
This file contains 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
<div ng-app="myApp" ng-controller="myCtrl"> | |
<p> | |
{{theTime}} | |
</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment