Commit c37c73d5 authored by Ujvari Gergely's avatar Ujvari Gergely

fuzzyTime directive listens to to call cleanInterval()

parent 0a45b18f
...@@ -363,10 +363,16 @@ fuzzytime = ['$filter', '$window', ($filter, $window) -> ...@@ -363,10 +363,16 @@ fuzzytime = ['$filter', '$window', ($filter, $window) ->
ctrl.$render = -> ctrl.$render = ->
scope.ftime = ($filter 'fuzzyTime') ctrl.$viewValue scope.ftime = ($filter 'fuzzyTime') ctrl.$viewValue
$window.setInterval => timefunct = ->
scope.ftime = ($filter 'fuzzyTime') ctrl.$viewValue $window.setInterval =>
scope.$digest() scope.ftime = ($filter 'fuzzyTime') ctrl.$viewValue
, 5000 scope.$digest()
, 5000
scope.timer = timefunct()
scope.$on '$destroy', ->
$window.clearInterval scope.timer
require: '?ngModel' require: '?ngModel'
restrict: 'E' restrict: 'E'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment