1

I'm using the ngx-pagination package in an Ionic with Angular application.

As you can see in the attached Stackblitz, I created a custom component which receives two input params currentStep and totalItems. We start in the HomeComponent page. If we click the "ClickMe" button, we go to the InstructionsPage, which makes use of the custom pagination template. The thing is that, if I press the "Go back" button, I return to HomeComponent but, if I press the "ClickMe" button again, an error is thrown.

enter image description here

Demo: https://stackblitz.com/edit/ionic-5s2qwc

chick3n0x07CC
  • 678
  • 2
  • 10
  • 30

1 Answers1

1

change goback method in instructions.component.ts to this it will not show error

  public goBack(){
    this.nav.pop();
  }
AbdulAzeem
  • 529
  • 4
  • 8
  • Thank you, this fixes the problem. But I'm still wondering what the root cause is. I mean, under the hood, what is the difference between `pop()` and `push()` in this case? – chick3n0x07CC Jul 17 '19 at 14:02
  • You're welcome.Kindly take a look at this https://stackoverflow.com/questions/6095530/maximum-call-stack-size-exceeded-error – AbdulAzeem Jul 18 '19 at 05:09