I received the following JSON data:
var scholars = [{"FirstName":"John","LastName":"Doe","Unit":"PA","Institution":"University of Haifa","teken":1,"FirstYearActive":"2007","hIndex":"3","j2014":0,"j2013":4,"j2012":3,"j2011":0,"j2010":0,"j20052009":2,"j20002004":0,"j19901999":0,"jPriorto1990":0,"ab2014":0,"ab2013":0,"ab2012":0,"ab2011":0,"ab2010":0,"ab20052009":0,"ab20002004":0,"ab19902000":0,"abPriorto1990":0,"c2014":5,"c2013":10,"c2012":7,"c2011":0,"c2010":3,"c20052009":2,"c20002004":0,"c19901999":0,"cPriorto1990":0,"b2014":0,"b2013":0...
I am seeking to total all instances of j2014 using this code snippet:
var j14sum = 0;
for (var i in scholars){
if (scholars[i].Institution == "University of Haifa")
j14sum += parseInt(scholars[i].j2014);
};
How can I implement this with angular.js and display the results using ng-table?
Appreciate any assistance!