javascript - UI-Select On-select callback being called multiple times -


i using ui-select. , there requirement call method on on-select of item. here code

 <ui-select ng-model="myctrl.selectedpersonid"           theme="bootstrap"  close-on-select="true"            title="search person id"          name="personsearch"           on-select="myctrl.onpersonselect()">      <ui-select-match allow-clear="true" placeholder="search person">          {{$select.selected.name}}      </ui-select-match>      <ui-select-choices repeat="item.id item in myctrl.personsresult"               refresh="myctrl.personsearch()"              minimum-input-length="1"               refresh-delay="1000">          <div ng-bind-html="item.name"></div>          <small>              name: {{item.name}}          </small>      </ui-select-choices>  </ui-select> 

the problem callback method on-select="myctrl.onpersonselect()" being called mutiple times. when user selects item, called , when user click on ui-select , input box appears type result, called. 1 selection gets called 2-3 times. whenever user clicks on input, on-select function gets called.

this might because of result data getting $http.

can me in this.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -