I have a simple array of object that contains again array,that I need to call and populate with ng repeat in angularjs. Here I need to populate the sublink in a
tag.The output should come one after other likeProject1a
Project1b
Project1c
Project1d
Project1e
but now the output is coming like
["Project1a","Project1b","Project1c","Project1d","Project1e"]
Here is the code below with html and angularjs.
html
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
<p ng-repeat="x in records">{{x.sublink}}</p>
</div
script
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.records =[{
"project_id": "1001",
"project_name": "Project1",
"project_desc": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
"project_manager": "Manager1",
"duration": "3 Years",
"team_size": "10",
"sublink": ["Project1a", "Project1b", "Project1c", "Project1d", "Project1e"]
}]
});
<div ng-repeat="x in records">
<p ng-repeat="link in x">{{link.sublink}}</p>
</div>
its not working
ng-repeatfor the sublinks.ng-repeat="link in x.sublink"link in x.sublink, notlink in x. After that it's{{link}}only, not{{link.sublink}}