Last active
December 29, 2015 18:19
-
-
Save mfrancois/7709692 to your computer and use it in GitHub Desktop.
Angular directive for send end when render is finish
This file contains hidden or 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
| 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); | |
| }); | |
| } | |
| } | |
| } | |
| }); |
This file contains hidden or 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
| <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