Search code examples
jqueryangulartypescriptngfor

Perform ngFor after function invokes it?


I have a lot of data to handle, so when the ngFor is used it is taking some time to render it. In normal Jquery way I used a loop and when more button is clicked it will render next 10 and used the .append(). Since I'm using angular I don't want the jQuery way. Suggest me another way if any exists.


Solution

  • I found the solution, actually one of the comments helped me. I had a big array and then i took only a part of it and rendered it when the component loaded. When the more button is clicked I pushed the next set of data into the rendered array. When the more button was clicked I just had to change the index values of from and to in the main array, so only a few set of data got pushed into rendered array. *ngFor is absolutely awesome.