Home > DeveloperSection > Forums > How to use Ng-repeat inside ng-repeat in Angularjs
Ankit Singh

Total Post:341

Points:2389
Posted on    February-25-2016 9:49 PM

 Angular JS JQuery  HTML  Angular JS 
Ratings:


 1 Reply(s)
 374  View(s)
Rate this:
We want to use ng-repeat inside ng-repeat in Angularjs.how will do this please tell  me.


aditya kumar Patel

Total Post:250

Points:1782
Posted on    February-25-2016 9:59 PM

@{

Layout = null;

}

<!DOCTYPE html>

<html>

<head>

<title>Forum</title>

<meta name="viewport" content="width=device-width" />

<script src="~/Scripts/jquery-1.9.1.js"></script>

<script src="~/Scripts/angular.js"></script>

<script>

var app = angular.module("myApp", []);

app.controller('MyCtrl', function ($scope) {

$scope.menuItems = [{ Productname: 'Samsung Galaxy S6 Compare', category: 'SAMSUNG' },

{ Productname: 'Samsung Galaxy S6 Edge', category: 'SAMSUNG' },

{ Productname: 'Compare Samsung Galaxy Core ', category: 'SAMSUNG' },

{ Productname: 'Lenovo Vibe Shot', category: 'Lenovo' },

{ Productname: 'Lenovo A6000', category: 'Lenovo' },

{ Productname: 'Lenovo K3 Note', category: 'Lenovo' }

];

$scope.categories = ['Lenovo', 'SAMSUNG']

})

</script>

</head>

<body ng-app="myApp" ng-controller="MyCtrl">

<div>

<ul ng-repeat="ca in categories">

<li style="font-weight:bold;">{{ca}}</li>

<li ng-repeat="menuItem in menuItems | filter:{category: ca}">{{menuItem.Productname}}</li>

</ul>

</div>

</body>

</html>


Don't want to miss updates? Please click the below button!

Follow MindStick