hi there,
is there any way to make splash screen as loadin/progress screen while getting response from api?
You're welcome! I'm glad to hear. If you have any more questions or need further assistance, feel free to ask.
Certainly, take your time to test it out. If you encounter any issues or have any questions, feel free to reach out. We're here to help!
hi there,
im using ngx spinner. works perfectly.
Thanks for your feedback!
Yes, you can create a splash screen that serves as a loading or progress screen while waiting for a response from an API in an Angular application. Here's a general outline of how to achieve this:
Create a Splash Component: First, create a new Angular component for your splash screen. You can use the Angular CLI to generate a new component:
ng generate component splash
< app-splash *ngIf="showSplash"></app-splash>
< app-root *ngIf="!showSplash"></app-root>
// Inside your component when start calling API
showSplash = true;
ngOnInit() {
// Simulate an API request
this.userService.getDataFromAPI().subscribe(
(response) => {
// Process the response data
// ...
// Hide the splash screen
this.showSplash = false;
},
(error) => {
// Handle errors
// ...
// Hide the splash screen
this.showSplash = false;
}
);
}
Great Thanks! ... let me try this and get back to you if any issue.