javascriptangulartypescriptpaginator

Is it possible to not trigger (page) event programatically in Paginator?


I would like to know if there is a way to not trigger the (page) event (and the method called with it) of paginator when using the method "this.paginator.nextPage()" ?

Something like the "{emitEvent: false}" of the "patchValue()" method.

Thanks for your answers.


Solution

  • I imagine you can use an auxiliar variable

    flag:boolean=false;
    

    And use

    this.flag=true;
    this.paginator.nextPage();
    this.flag=false;
    
    <paginator (page)="!flag && doSomething()"></paginator>