Last active
August 29, 2015 14:04
-
-
Save philipproplesch/d301259f7d9d6ea1d1d9 to your computer and use it in GitHub Desktop.
ngRepeatDone
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
'use strict'; | |
angular.module('FooApp') | |
.directive('repeatDone', ['$timeout', function ($timeout) { | |
return { | |
restrict: 'A', | |
link: function postLink(scope, element, attrs) { | |
var action = attrs.repeatDone; | |
if (scope.$last && action !== '') { | |
$timeout(function() { | |
scope.$eval(action); | |
}); | |
} | |
} | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment