ng-sortable icon indicating copy to clipboard operation
ng-sortable copied to clipboard

Placeholder template and data binding

Open thibauds opened this issue 8 years ago • 0 comments

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')));
    }
}

thibauds avatar Feb 23 '17 14:02 thibauds