扫码关注官方订阅号
1、每个页面的动态数据都是在控制器里面用$http.get()获取的,然后在html页面用ng-repeat循环出来!2、跳转页面 返回上一页我都是用a标签写的 出现问题:每次返回上一页的时候都要重新加载一次数据,这样给用户体验太差了!
认证高级PHP讲师
你路由用的啥?ui-router?单页就不要直接a标签跳了,每次都要重新加载资源的。
ui-router
一般单页路由都有对应的跳转方法的。
router-link='/xxx/xxx'
在controller,$state.go('/xxx/xxx');
$state.go('/xxx/xxx');
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你路由用的啥?
ui-router
?单页就不要直接a标签跳了,每次都要重新加载资源的。一般单页路由都有对应的跳转方法的。
Ng1 ,ui-router
router-link='/xxx/xxx'
在controller,
$state.go('/xxx/xxx');