I have JSON Array object as shown below.
$scope.items =
[
{Name: \"Soap\", Price: \"25\", Quantity: \"10\"},
{Name: \"Bag\", Price: \"100\",
I have just started checking out Angular(so im quite sure there are other ways to get it done which are more optimum), and i came across this question while searching for examples of ng-repeat.
The requirement by the poser(with the update):
"...but my real requirement is display the items as shown below.."
looked real-world enough (and simple), so i thought ill give it a spin and attempt to get the exact desired structure.
angular.module('appTest', [])
.controller("repeatCtrl", function($scope) {
$scope.items = [{
Name: "Soap",
Price: "25",
Quantity: "10"
}, {
Name: "Bag",
Price: "100",
Quantity: "15"
}, {
Name: "Pen",
Price: "15",
Quantity: "13"
}];
})
{{key}}
{{val}}
The limitTo:(n) filter is the key. Im still not sure if having multiple ng-repeat is an optimum way to go about it, but can't think of another alternative currently.