akveo / akveo/ng2-smart-table

Why the table execute all functions when it's created?

Aperta
#763 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
1.6k
Fork
867
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

_**Premise**_ I have little experience with Angular, but I think my problem it concerns **_Angular lifecycle hooks_**.

I'have a SmartTable component, it gets the data from api REST from server.
When I entry for the first time in the page, I've noticed that are _executed_ all function that I've defined in the smarttablecomponent.**ts**.

This behavior is critical in my scenario, since I need to invoke other api RESTs, for example when an User click on the Row I get other data from server... But these happens at the first access when the view is created. Why? I've omitted something?

Thanks, and I take this opportunity to congratulate with **akveo Team**!

**### EDIT**: I've resolved strange behavior. Changing the property of **_ng-smart-table_** tag from:
`(rowSelect)="onUserRowSelect($event)"`
to
`(userRowSelect)="onUserRowSelect($event)"`
In ths way when the view is exactly how I expect it to be: no rest call executed and no UI components created involuntarily

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.