Open shivaprakashboss opened 6 years ago
I even tried with setting the variable to undefined or "" or null or {} but no luck this happens for single selection but multiple it is working fine.
On clicking the reset button ,In the controller ,scope variable have the new values that is not reflecting on the UI where it has previous selected values.this is not happening on first time loading of page where I fetch the same data from database.
No built-in reset (unselect) in single select mode. You have to reset your model to undefined or null.
I have reset the model to undefined as well as null but there is no expected behaviour. Say $scope.users={} or $scope.users=null I didn't see the value getting reset. Please help
Even if I reset to some other value also it is not resetting to that value let me know what I am missing.
could you please share the example how you do it and share the nya.bootstrap.select.js file. today morning i checked the reset with latest nya.bootstrap.select.js file. reset is working fine when we change the value in the controller but after that if i change the items in the dropdown ,model not getting updated.Please help
Click on my text in the previous comment, it is a link, it glows blue.
But to reset the model to undefined and change the present data is a different thing.
Try to add deep-watch="true"
on the same element as "nya-bs-option"
i have added deep-watch and sorry angular version is 1.3 not 1.5 please help
is the version mismatch makes this behave indifferent ?
i have gone through your link and it is working as expected
I added a complete data set change and a single data change, also the example use angular 1.3 now and everything is working like it should be.
somehow it is not working in our project. i have tried to implement as like in the link but unable to succeed.
what might be the issue why i am not able to implement the feature which is already existing.
Maybe some directive like ng-if or ng-repeat creates a child scope which overrides your name. It's suggested to use controllerAs instead of directly manipulate $scope.
sir give me an example how i should use $scope or controller.
where i should use this controllerAs ?
It really depends on your application design (for example if you set up your controller in ngRoute or ui-router, you should config controllerAs at route config) To be simple, a controllerAs alias can be treated as a model in $scope which all other model is its property. Here is an article talk about this topic. https://johnpapa.net/angularjss-controller-as-and-the-vm-variable/
Ok I will try and update the behaviour thanks.
I am using nya bootstrap select for dropdowns when I click reset to bring back the values from the DB values are not resetting on UI .The old value getting retained on screen even though in controller the values are fetched from DB. How to tackle this ? Please help we badly need this