Importance of Promise Object in angular js

Site Title

Hey guys, Writing this blog just to share an experience with you all. We have an input box which accepts keyword from user. We are sending api call to search that keyword, not when user enters full keyword, but when user enters a single character. And then it displays those keywords in drop-down.

We are using ngTagsInput plugin to add or select keyword. We send first api call when user enters first three characters and other calls are sent for each character entered by user. Due to this one issue occurs. Api responses are not received at same speed at which the user is entering the characters. So old response were displayed in the drop-down instead of new ones.

Ex. -> user entered ‘abcdef’, so, we have response for the api call which is given for ‘abcd’, but response for ‘abcde’ and ‘abcdef’ are pending. What we expect, is that…

View original post 388 more words

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.