<!doctype html>
<html>
<head>
<title>foreach in angularjs mvc 5</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.1/angular.min.js"></script>
<script>
var app = angular.module("foreachApp", []);
app.controller("TodoForEach", function($scope) {
$scope.userDetails = [{
name: 'Anil Singh',
age: 30
}, {
name: 'Reena Singh',
age: 25
}];
$scope.foreachInAngularJs = function() {
app.forEach($scope.userDetails, function(val) {
console.log(val.name + ' ' + val.age);
});
};
}
</script>
</head>
<body ng-app="foreachApp">
<div ng-controller="TodoForEach">
<div>TODO: code-sample.com</div>
</div>
</body>
</html>
// Code goes here
/* Styles go here */