I want to get the maximum and minimum value from json in angular js my json:
{ "data":[ { "name": "ranjith", "age": 22 }, { "name": "rahul", "age": 20 }, { "name": "jinesh", "age": 25 }, { "name": "vishnu", "age": 24 } ] }
and my controller: -
var app = angular.module('myApp', ['']); app.controller('myCtrl', function($scope, data) { $scope.data = data.data; $scope.min=""; $scope.max=""; }; });
I want to get the minimum and maximum value from an array and store it in the variables min and max
source share