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 : </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"> unknown </span> <span ng-if="product.vendorcode || product.vendorname"> {{product.vendorcode}} {{product.vendorname}} </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> unknown </strong></span> <span ng-if="store.vendorcode || store.vendorname"><strong> {{store.vendorcode}} {{store.vendorname}} </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
Post a Comment