TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Ng-repeat inside ng-repeat
Nemilidinne Ashokreddy
Nov 25
2015
Code
836
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<!DOCTYPE html>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<title></title>
<script src=
"Scripts/angular.min.js"
></script>
<script>
var app = angular.module(
"myApp"
, []);
app.controller(
'MyCtrl'
, function ($scope) {
$scope.menuItems = [{ name:
'dish1'
, category:
'soup'
},
{ name:
'dish2'
, category:
'beef'
}];
$scope.categories = [
'beef'
,
'soup'
]
})
</script>
</head>
<body ng-app=
"myApp"
ng-controller=
"MyCtrl"
>
<div>
<ul ng-repeat=
"cate in categories"
>
<li>{{cate}}</li>
<li ng-repeat=
"menuItem in menuItems | filter:{category: cate}"
>{{menuItem.name}}</li>
</ul>
</div>
</body>
</html>
Angularjs
Ng-repeat