s-yadav / angulargrid

Pinterest like responsive masonry grid system for angular
MIT License
277 stars 105 forks source link

Remove all items and load new ones #123

Open redhelling21 opened 7 years ago

redhelling21 commented 7 years ago

Hello, I searched in the issues and on the internet, but I can't find a solution to my problem... By clicking on a button (for example), i want to remove all the items from the grid, and then load new ones. I tried with a simple for loop made with splice and angularGridInstance.gallery.refresh, but even with #96 it does not work at all... Any ideas ?

krishnachhatbar commented 7 years ago

Hello,

You can do the following to solve your issue,

initialize all variables before loading new items

$scope.card = {}; $scope.card.title = 'test'; $scope.page = 0; $scope.shots = []; $scope.loadingMore = false; $scope.totalImages = 0; $scope.totalPages = 1;

now call this ( your ) method

$scope.loadMoreShots();