How to get the array value and in structurized using Mongoose?

99封情书 提交于 2019-12-08 00:19:29

Try this

<html>
<body>
	<div Class="container" ng-app="myapp" ng-controller="namesctrl">
		
		<table>
			<thead>
				<th>
					UiName
				</th>
				<th>
					View
				</th>
				<th>
					Edit
				</th>
			</thead>
			<tr ng-repeat="mgr in Manage_Roleser.UIList">
				<td>
					{{mgr.UiName}}
				</td>
				<td>
				|{{mgr.View}}
				</td>
				<td>
					{{mgr.View}}
				</td>
			</tr>
		</table>
	</div>  


	<script Src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script>

	<script>
		var app=angular.module("myapp", []);
		app.controller("namesctrl", function($scope){

			$scope.Manage_Roleser= 
			{
				"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
			}]
		}
			

		});



	</script>
</body>
</html>

First off all you json is not a valid one please check that and go through the below snippest

var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope) {
  $scope.Manage_Roleser =[ {
    "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
        }]
       } ]
});
<!DOCTYPE html>
<html ng-app="plunker">

  <head>
    <meta charset="utf-8" />
    <title>AngularJS Plunker</title>
    <script>document.write('<base href="' + document.location + '" />');</script>
    <link rel="stylesheet" href="style.css" />
    <script data-require="angular.js@1.4.x" src="https://code.angularjs.org/1.4.12/angular.js" data-semver="1.4.9"></script>
    <script src="app.js"></script>
  </head>

  <body ng-controller="MainCtrl">
 
 <div>
  
     <div  ng-repeat="i in Manage_Roleser[0].UIList">
       {{i.UiName}} | {{i.View}}   {{i.Edit}}
      
       
     </div>
   
 </div>
  </body>

</html>
Add your headings like as you want.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!