Skip to content

Commit

Permalink
add ng-repeat listen event repeat-begin and repeat-done
Browse files Browse the repository at this point in the history
  • Loading branch information
taobataoma committed May 10, 2017
1 parent 302a9af commit c2b952c
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
(function () {
'use strict';

angular.module('core')
.directive('repeatBegin', repeatBegin);

function repeatBegin() {
var directive = {
restrict: 'A',
link: link
};

return directive;

function link(scope, element, attrs) {
if (scope.$first) {
if (attrs.repeatBegin) {
scope.$eval(attrs.repeatBegin);
}
}
}
}

angular.module('core')
.directive('repeatDone', repeatDone);

Expand Down

0 comments on commit c2b952c

Please sign in to comment.