how to refresh the report on Angular 6
I used your example from GitHub (https://github.com/WebDataRocks/pivot-angular/tree/master/src/app).
<wbr-pivot #pivot1 [toolbar]=”flag”
[width]=”‘100%'”
[height]=”500″
[report]=”getReport()”>
I need to set the [report] after a asynchronous request http.get().
I used a getReport() method for return the data to [report], but when the component wbr-pivot is initiated the http request still don’t ended and the getReport() method return a data empty;
So, I need to set the [report] and refresh the component. how to do that?
2 answers
Hello,
Thank you for the question.
The correct sequence for your case is:
- Initialize the empty pivot and wait for
ready
event - Create a HTTP get request to the report and wait for the JSON response
- Use `this.child.webDataRocks.setReport()` API method to set the report
Please let us know if it helps.
Regards,
WebDataRocks Team
I used your exemple from https://github.com/WebDataRocks/pivot-angular/blob/master/src/app/app.component.ts.
and now I understand what I should do.
thanks for helping!