I want to iterate over multiple array elements named urls and names. Below is the code where only urls are iterated. How can I use names also with urls?
JS
var app = angular.module('plunker',[]);
app.controller('Nav', function($scope) {
$scope.names = [
{
"name" : "myname 1",
},
{
"name": "myname 2"
}
]
$scope.urls = [
{
"url" : "http://google.com",
},
{
"url": "http://cnn.com"
}
];
});
HTML
<body ng-controller="Nav">
{{urls}}
{{names}}
<div ng-repeat="link in urls">
<input type="text" ng-model="link.url" />
<input type="text" /> //Want name here
</div>
</body>