Created
August 1, 2014 22:21
-
-
Save naudo/c4605d7e7e686d569881 to your computer and use it in GitHub Desktop.
Angular.js help
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
| ````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