dnauck / angular-advanced-searchbox

A directive for AngularJS providing a advanced visual search box
http://dnauck.github.io/angular-advanced-searchbox/
MIT License
226 stars 98 forks source link

RestoreModel function allowMultiple & array issue #77

Open phpephpe opened 7 years ago

phpephpe commented 7 years ago

The RestoreModel function doesn't seems to handle correctly the reload of array data (set with an searchParam).

My guess is that this function should check that and iterate on it, I would suggest to do this on line 287

if (searchParam.allowMultiple && angular.isArray(value)) {
     angular.forEach(value, function(val, key) {
          $scope.addSearchParam(searchParam, val, false);
     });
} else {
     $scope.addSearchParam(searchParam, value, false);
}

Please let me know if that sounds correct. Thanks for your component !