I have another problem that I do not know how to do it.
I have a Json with several data and I have to make an average between 2 json data
angular.module('playersApp', []).controller("AllPlayerssCtrl", function ($scope) {
$scope.players = [
{
"stats": [
{
"name": "goals",
"value": 5
},
{
"name": "losses",
"value": 20
},
{
"name": "wins",
"value": 48
},
{
"name": "draws",
"value": 23
},
{
"name": "fwd_pass",
"value": 1533
},
{
"name": "goal_assist",
"value": 2
},
{
"name": "appearances",
"value": 80
},
{
"name": "mins_played",
"value": 6953
},
{
"name": "backward_pass",
"value": 308
}
]
},...];
I have to show the average number of goals per game by window, that is, divide the value of goals between the value of mins_played and I do not know how to do the function by taking those values from the json and from there in the ng-if of the html call that function to show the result.
If you can help me please, I would appreciate it.
Thank you very much