Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when deleting all "sv-part" list. #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsujiura
Copy link

Fixed a bug that caused an error when deleting all with an application that has the function to delete "sv-part".

angular
    .module('testApp', ['angular-sortable-view'])
    .controller('AppController', function($scope) {
        $scope.lists = [
            [1, 2, 3],
            [4, 5, 6],
            [7, 8, 9]
        ];
        $scope.allDelete = function() {
            $scope.lists = []
        };
    });
<body ng-controller="AppController as app">
    <div sv-root>
        <div ng-repeat="list in lists" sv-part="list">
            <div ng-repeat="card in list" sv-element>
                {{card}}
            </div>
        </div>
        <button ng-click="allDelete()">all delete</button>
    </div>
</body>

The following error occurs when pressing "all delete" button.
TypeError: Cannot read property 'filter' of undefined

@alejandroiglesias
Copy link

@kamilkp this would avoid errors in certain component destroy cases. Can you please merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants