Skip to content

Instantly share code, notes, and snippets.

@naudo
Created August 1, 2014 22:21
Show Gist options
  • Select an option

  • Save naudo/c4605d7e7e686d569881 to your computer and use it in GitHub Desktop.

Select an option

Save naudo/c4605d7e7e686d569881 to your computer and use it in GitHub Desktop.
Angular.js help
````html
<div ng-controller="TodoItemController">
<div class="thing" ng-repeat="thing in things" rebind-draggable-directive>
thing {{thing}}
</div>
</div>
````
````javascript
angular.module('myApp', [])
.directive('rebindDraggableDirective', function() {
return function(scope, element, attrs) {
if (scope.$last){
// iteration is complete, do whatever post-processing
// is necessary
$(element).draggable(...);
}
};
});
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment