I am currently developing an iOS app using the Ionic framework with AngularJS. In my app, I have implemented the following routing example:
.state('app.friends', {
url: '/friends',
cache: false,
requireLogin: true,
views: {
'menuContent': {
templateUrl: 'templates/friends.html',
controller: 'friendsCtrl'
}
}
})
When loading the template friends.html, its corresponding controller is friendsCtrl. Within friendsCtrl, there is an Ajax function that calls an API to retrieve a list of friends in JSON format. The issue I am facing is that the template does not load in the view until the Ajax call is completed. Sometimes, especially with large data on the API, this process can take a long time. Therefore, I would like to display an empty view until the Ajax call is finished. While there are solutions available for completing the Ajax call before rendering the view, I specifically need guidance on how to render the view before the Ajax call completes. Any suggestions on how to achieve this would be greatly appreciated.
Thank you