Advertisement
Fhernd

app.js

Dec 3rd, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. var cronApp = angular.module('cronApp', [
  4.     'cronAppCtrlrs'
  5. ]).directive('ngClock', function () {
  6.     return {
  7.         restrict: 'A',
  8.         scope: {
  9.             getTime: "="
  10.         },
  11.         template: '<div>{{getTime}}</div>',
  12.         controller: ['$scope', '$interval', function($scope, $interval){
  13.             $interval(function () {
  14.                 var time = moment(new Date()).format('hh:mm:ss');
  15.  
  16.                 $scope.getTime = time;
  17.             }, 1000);
  18.         }]
  19.     };
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement