diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-11 03:55:52 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-11 03:55:52 +0200 |
commit | ea9ebd4826fe9807af5bc17e786b3dc58f163970 (patch) | |
tree | 2894b40614ebe977797cea5745b215e2a2851f61 /js/directive/NewsTimeout.js | |
parent | 594b92f649d8ed8a705f1af23639463078170d46 (diff) |
port to es5 and add es6 shims for object prototypes instead
Diffstat (limited to 'js/directive/NewsTimeout.js')
-rw-r--r-- | js/directive/NewsTimeout.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/directive/NewsTimeout.js b/js/directive/NewsTimeout.js index dc87dd5aa..37458a61b 100644 --- a/js/directive/NewsTimeout.js +++ b/js/directive/NewsTimeout.js @@ -7,7 +7,7 @@ * @author Bernhard Posselt <dev@bernhard-posselt.com> * @copyright Bernhard Posselt 2014 */ -app.directive('newsTimeout', ($timeout) => { +app.directive('newsTimeout', function ($timeout) { 'use strict'; return { @@ -15,13 +15,13 @@ app.directive('newsTimeout', ($timeout) => { scope: { 'newsTimeout': '&' }, - link: (scope) => { - let seconds = 7; - let timer = $timeout(scope.newsTimeout, seconds * 1000); + link: function (scope) { + var seconds = 7; + var timer = $timeout(scope.newsTimeout, seconds * 1000); // remove timeout if element is being removed by // for instance clicking on the x button - scope.$on('$destroy', () => { + scope.$on('$destroy', function () { $timeout.cancel(timer); }); } |