How do I prefetch url's in ionic/angularjs?

前端 未结 4 1651
渐次进展
渐次进展 2021-02-19 12:11

I am pretty new to ionic 1 and I am working on an application (with Ionic 1 and angular js) with multiple URLs where each URL brings up a list of categories, followed by a list

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-19 12:59

    You can make multiple Asynchronous service calls in background using $q. Make a list of URL's in an array and call them at once using $q.all(listOfURL). Using promises retrieve each response.

    By making this asynchronous you can save lot of time.

    After getting response you can either store them in $rootScope or in localStorage/sessionStorage.

提交回复
热议问题