ng-sortable
ng-sortable copied to clipboard
Placeholder template and data binding
Hi, I would like to use data binding in the placeholder. Would you accept a PR ?
I was thinking about something like:
createPlaceholder = function (itemScope) {
if (typeof scope.sortableScope.options.placeholder === 'function') {
var content = $compile(scope.sortableScope.options.placeholder(itemScope))(itemScope);
return angular.element(content);
} else if (typeof scope.sortableScope.options.placeholder === 'string') {
var content = $compile(scope.sortableScope.options.placeholder)(itemScope);
return angular.element(content);
} else {
return angular.element($document[0].createElement(itemScope.element.prop('tagName')));
}
}