Skip to content

ng-sortable does not wait ($watch) for $scope.ngSortable #8

@brennancheung

Description

@brennancheung

When items is undefined at the time the template is loaded the directive does not work.

This is very common when the items are populated from a REST API call.

Ex:

In controller:
setTimeout(function(){ $scope.items = [1,2,3]; }, 5000);

In HTML:
<div ng-sortable="items">...</div>

ng-sortable should implement a $watch for the $scope.ngSortable and only run the current linking code when it is defined and an array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions