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

restoreModel Issue with multiple values allowed #87

Open
gagjules opened this issue Jun 6, 2018 · 1 comment
Open

restoreModel Issue with multiple values allowed #87

gagjules opened this issue Jun 6, 2018 · 1 comment

Comments

@gagjules
Copy link

gagjules commented Jun 6, 2018

Hello there.

I had an issue when I was trying to restore data in my angular-advanced-searchbox model.
My model was quite simple. It contained properties by default with multiple values like this example:

{mySearchParam:['value1', 'value2']}

But in this situation, the system failed with a circular trouble.
I fixed it by replacing code in the restoreModel function stored in the angular-advanced-searchbox-tpls.js file.

I replaced...
// if (searchParam !== undefined)
// $scope.addSearchParam(searchParam, value, false);
...by:
if (searchParam !== undefined){
if(angular.isArray(value)){
for(var key in value){
$scope.addSearchParam(searchParam, value[key], false);
}
}
else{
$scope.addSearchParam(searchParam, value, false);
}
}

It's probably not the best solution, but it works for me.
Maybe dnauck will be inspired by this idea ;)

Gagjules

@RZR666
Copy link

RZR666 commented Feb 28, 2019

thanks, I was just having this issue!

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

No branches or pull requests

2 participants