Code uitvoeren in Angular nadat de 'ng-repeat' klaar is
Op de volgende manier kun je code uitvoeren, pas als 'ng-repeat' klaar is.
Html:
Javascript:thing {{thing}}
function Ctrl($scope) {
$scope.things = [
'A', 'B', 'C'
];
}
angular.module('myApp', [])
.directive('myPostRepeatDirective', function() {
return function(scope, element, attrs) {
if (scope.$last){
// iteration is complete, do whatever post-processing is necessary
}
};
});
Bron: http://stackoverflow.com/a/13775176/40676
Reacties
Een reactie posten