-
Notifications
You must be signed in to change notification settings - Fork 496
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
clear angucomplete-alt after button click #60
Comments
Doesn't look like you can. It would be nice if you could pass a function from your controller into the clear-selected or some other attribute and have angucomplete add a listener to that function to clear the string when the function is called. |
I created a Pull Request for this: You can use the branch on my fork in the meantime if you like in your bower.json: Branch can be found here: Basically in your controller if you have a button calling a function called
|
Quick note: This approach will clear the inputs on ALL angucomplete fields. So if you have more than one on a view this may not be exactly what you want. In my case there is only one angucomplete on the view so it doesn't matter. |
Thanks for the answer. But I have more than one on a view. I'll try something similar. |
I made as small adjustment, and it worked fine with multiple directive in a view. $rootScope.$broadcast('angucomplete-alt:clearSearch', { target: 'idAutocomplete' }); and in angucomplete-alt
Thanks. |
Note that the syntax has changed. See the description at the bottom of the angucomplete-alt home page: |
Hi. How do to clear the content of the input angucomplete-alt (scope.searchStr),by controller, for example, when the user click a button?
The text was updated successfully, but these errors were encountered: