Open gverma14 opened 7 years ago
You can do ti this way:
$scope.addItemListener = function (scope, itm) {
scope.$on('gridster-item-transition-end', function (event, source) { ... });
}
where scope is from here:
<div ng-repeat="itm in items" gridster-item="itm">
<div ng-init="addItemListener(this, itm)">
</div>
</div>
I am currently using gridster items as wrappers for my html content and one thing that I could not get around was ensuring that the final size of my content matches the size of my widget after the transition is complete. I tried using the resize stop function but it gives me the size of the widget at the point right before the transition. I had to change the event gridster-item-transition-end to be a $emit instead of a $broadcast in order for my controller to recognize it. When I ran grunt locally with the tests I got back a failure. I'm not sure if this would be in line with the desired behavior / intended purpose of the event. Is this a valid approach?