Skip to content

Instantly share code, notes, and snippets.

@mfrancois
Last active December 29, 2015 18:19
Show Gist options
  • Select an option

  • Save mfrancois/7709692 to your computer and use it in GitHub Desktop.

Select an option

Save mfrancois/7709692 to your computer and use it in GitHub Desktop.
Angular directive for send end when render is finish
var main = angular.module('main', []).controller('mainCtrl', function ($scope) {
$scope.initTransformation = function () {
jQuery($element).jqTransform();
$scope.isStarted = true;
};
});
main.directive('onFinishRender', function ($timeout) {
return {
restrict: 'A',
link: function (scope, element, attr) {
if (scope.$last === true) {
$timeout(function () {
scope.$eval(attr.onFinishRender);
});
}
}
}
});
<div>
<div ng-repeat="car in cars" on-finish-render="initTransformation()" ng-animate="'animate'">
<label>{{car.libelle}}</label>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment