angular.js - ng写的单页面,每次返回上一页的时候,都要重新加载一次数据即(loading)等待过程,怎么解决这个问题?
PHP中文网
PHP中文网 2017-05-15 17:09:08
0
1
545

1、每个页面的动态数据都是在控制器里面用$http.get()获取的,然后在html页面用ng-repeat循环出来!
2、跳转页面 返回上一页我都是用a标签写的
出现问题:每次返回上一页的时候都要重新加载一次数据,这样给用户体验太差了!

PHP中文网
PHP中文网

认证高级PHP讲师

reply all (1)
phpcn_u1582

What do you use for routing?ui-router? Don’t jump directly to the a tag on a single page. You have to reload the resources every time.

Generally, single-page routing has corresponding jump methods.

Ng1, ui-router

  1. router-link='/xxx/xxx'

  2. In controller,$state.go('/xxx/xxx');

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!