Angularjs Grouping


#1

I would like to group if the product codes are the same. Please help me

controller code=========
if( cartObj.cart.find(id)!=-1 && cartObj.cart.findtpysize(comment)!=-1 ){
cartObj.cart[cartObj.cart.findtpysize(comment)].cart_item_qty+=1;
cartObj.total_qty+= 1;
cartObj.total_amount+=( parseInt( cartObj.cart[cartObj.cart.findtpysize(comment)].cart_item_price) );
}else{
cartObj.cart.push( { “cart_item_id”: id , “cart_item_name”: name , “cart_item_comment”: comment, “cart_item_price”: price , “cart_item_qty”: qty } );
cartObj.total_amount+=parseInt(price);
}

html code=========
div ng-repeat="item in cart"
div class=“list card"
div class=“item item-divider”>product_code: {{item.cart_item_id}}</div
div class=“item item-body"
img ng-src=”{{‘img/’+ item.cart_item_image +’.jpg’}}” width=“100%” height=“auto” style="width: 100%; height: auto;"
form class=“list”></form
div
p></p
p>product_size: {{item.cart_item_comment}}</p
p>{{item.cart_item_qty}} x {{item.cart_item_price| number : 0}} =
total_price: {{ item.cart_item_qty * item.cart_item_price | number : 0}}</strong
</p
</div