I am using MeanStack AngularJS. I stored the values into MongoDB like this:
Data format
"RoleName" : "Verify",
"IsActive" : true,
"UIList" :
{
"UiName": "One",
"View" : false,
"Edit" : false
},
{
"UiName": "Two",
"View" : false,
"Edit" : false
},
{
"UiName": "Three",
"View" : false,
"Edit" : false
},
{
"UiName": "Four",
"View" : false,
"Edit" : false
},
{
"UiName": "Five",
"View" : false,
"Edit" : false
}
Contoller
$http.get('/Manage_Datashow').success(function (response) {
$scope.Manage_Roleser = response;
});
Server
app.get('/Manage_Datashow', function (req, res) {
db.New_Role.find(function (err, docs) {
console.log(docs);
res.json(docs);
});
});
Here I attached my sample code. I want to bind the values in list using ng-repeat
.
My code:
<ul ng-repeat=Manage_Rolese in Manage_Roleser >
<li>{{Manage_Rolese.UIList.UiName}}</li>
<li>{{Manage_Rolese.UIList.View}}</li>
<li>{{Manage_Rolese.UIList.Edit}}</li>
</ul>
Example:
I need output like this.