html - ng-change called twice intermittently -


i have weird problem in view. have checkbox created dynamically display items in array. here's code view:

    <form name="checkpriceform" novalidate>         <label class="item item-input">             <p>category : &nbsp; </p>             <select ng-model="check.category" ng-change="checkprice()">                 <option ng-repeat="selection in checkpricecategory" value="{{selection}}">{{selection}}</option>             </select>         </label>         <p></p>         <div ng-if="displaytable==true">             <div class=checkboxelement                  ng-repeat="product in yourproductsall | unique:'[vendorkey, storetype]' | orderby: '[vendorcode, vendorname]'">             <label >                 <input ng-change="selectstores()"                     type="checkbox"                     ng-model="selected.stores[product.vendorkey + product.storetype]"/>                 <span ng-if="!product.vendorcode && !product.vendorname">&nbsp;unknown&nbsp;</span>                  <span ng-if="product.vendorcode || product.vendorname">&nbsp; {{product.vendorcode}} {{product.vendorname}}&nbsp;</span>             </label>             </div>         </div>     </form>     <div ng-if="displaytable==true">         <table width="100%">             <tr ng-if="yourproductscolumn.length > 0">                 <th class="tabledetailname" width="50%" ><strong>product</strong></th>                 <th class="tabledetailelement" ng-repeat="store in selectedstores | orderby: '[vendorcode, vendorname]'" >                     <span ng-if="!store.vendorcode && !store.vendorname"><strong>&nbsp;unknown&nbsp;</strong></span>                      <span ng-if="store.vendorcode || store.vendorname"><strong>&nbsp; {{store.vendorcode}} {{store.vendorname}}&nbsp;</strong></span>                     </th>             </tr>             <tbody ng-repeat="productdetail in yourproductscolumn | groupby: 'productcategory'">                 <tr>                     <td colspan="10"><strong>{{productdetail[0].productcategory}}</strong></td>                 </tr>                 <tr ng-repeat="productname in productdetail">                     <td>{{productname.productname}}</td>                     <td class="tabledetailelement" ng-repeat="store in selectedstores | orderby: '[vendorcode, vendorname]'">                         <div class="button button-small"                               ng-if="productname[store.vendorkey].unitprice"                              ng-click="openmodal(productname[store.vendorkey])">{{formatamount(productname[store.vendorkey].unitprice)}} </div>                     </td>                 </tr>              </tbody>         </table>     </div> 

now, view works if array yourproductsall contains few elements (maybe less 20 items). problem having when array starts bigger, more 100 items, checkprice() function in checkbox called twice. note called twice - intermittently , there no obvious pattern can determine causes problem. have encountered problem before? suggestions on how should try debug problem?


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -