Calculate sum of element array ionic 2

OK, at this point I have to conclude that you’re just trolling me. I told you yesterday:

This is complete abuse of pipes and will never work. You have to do all the computation in the controller. Do not rely on template constructs like ngFor for any of it.

I told you just a few minutes ago:

you need to solve that problem COMPLETELY IN CONTROLLER CODE.


No, somebody else is going to have to take over. I can’t deal with you any more.

ook as you like :slight_smile: :open_mouth:

Here I create a model

nbr: number;
// other variables

getNb() {
  // ...
  this.members = data.CourseHsCheval ;
if ( curent.CourseHsCheval.rang ==1) {
  this.nbr = this.members.reduce((previous, current) => {
    return previous + 1 ; }
  }, 0);