Check few of these out.
http://www.byteblocks.com/Post/Create-a-ticking-clock-using-angularJS-using-timeout-service
http://www.byteblocks.com/Post/Create-countdown-clock-using-angularJS-services
On Wednesday, July 2, 2014 10:24:22 PM UTC-4, Darin Hensley wrote:
>
> I am trying to write a function to where I can call Date.now() in the
> template as a function... {{ cliecntClock.now() | date: 'yyyy-MM-dd
> HH:mm:ss' }} and have it tick like a clock.
>
> Questions:
> 1) would there be anything wrong with attaching a function to rootScope
> if all controllers will use it?
> 2) As a service, is this correct?
>
> angular.module('monitorApp')
> .factory('clockTicker', function($interval) {
> //digest to make the clock tick
> $interval(function(){ }, 1000);
> return {
> clientClock: function() { return Date; }
> }
> });
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.