I am using ngTagInput library ref: http://mbenford.github.io/ngTagsInput/ which I customized a little to meet my requirement.
Now I want dropdown be shown with fetched data as soon as input is focused.
E.g.
users = ["stack" ,"subj" ,"owner"];
1. Now on focusing input ("Add User"), all three users should be fetched.
2. After I input "s",then, only "stack" and "subj" should be shown.
For that, I tried ng-focus= "newTagChange()" instead of ng-change="newTagChange()".
But it didn't work as expected.
I also tried with minLength="0" which failed as well.
Find current implementation at:Plunker
http://plnkr.co/edit/shgh40H3Nc0eEeM4Lidd?p=preview
Please suggest.
That feature is now available in the master branch of the project on GitHub. You might want to rebase your fork on top of it.
Here's how to enable that behavior:
<tags-input ng-model="tags">
<auto-complete source="loadTags($query)"
load-on-empty="true"
load-on-focus="true">
</auto-complete>
</tags-input>
Setting loadOnEmpty
to true will make the directive call the load function when the input content becomes empty, and setting loadOnFocus
to true will do the same when the input gains focus.