Skip to content

Instantly share code, notes, and snippets.

@philipproplesch
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipproplesch/d301259f7d9d6ea1d1d9 to your computer and use it in GitHub Desktop.
Save philipproplesch/d301259f7d9d6ea1d1d9 to your computer and use it in GitHub Desktop.
ngRepeatDone
'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