Home > database >  Is there a way to show data on the UI without using an event handler in Angular?
Is there a way to show data on the UI without using an event handler in Angular?

Time:10-27

in my Angular project I'm getting data from an API using a service. Is there a way to show this data on the UI without firing an event? I saw a lot of examples which do this by clicking on a button, however I do not want to click on a button to show the data. I want this to be done whenever my page is loaded. Thanks.

CodePudding user response:

You could listen for AfterViewInit

CodePudding user response:

If you want to call API on every time of page loading you can call API in ngOnInit.

  • Related