angularJS ui router 多视图单独刷新问题
场景:视图层级如下
view1
--view11
--view111
需求:view11的一个动作过后,单独刷新view12
解决方式:修改层级设计
view1
--view11
--view111
结论:ui router不支持同级别views单独刷新, ui router 原则是通过state控制视图,不要直接控制views
这个设计和只能更新mvvm scope的变量,尽量不要操作dom元素一样,个人认为是很2..........
我的场景view11并行的有很多view13 view14 view15 view16,每个都有操作刷新view12,
按state更新的话,路由要重新嵌套,每个下面都要嵌套view111,麻烦的很。。。
The answer is - hierarchy should be built from states, not via views.
You should really study the doc (which is pretty clear, short and easy to read)
And then maybe follow this:
Nested states or views for layout with leftbar in ui-router?
to see, that we can
- reload any child state (and trigger its
resolves) - without reloading its parent - be sure that all views inside of reloaded states are reloaded (each view controller is re-init)
So, the answer should be
split your hierarchy into state hierarchy, not view. Navigate to and among children to change the child views... while profit from parent stable views
Check the plunker here
angularJS ui router 多视图单独刷新问题的更多相关文章
- [转]AngularJS+UI Router(1) 多步表单
本文转自:https://www.zybuluo.com/dreamapplehappy/note/54448 多步表单的实现 在线demo演示地址https://rawgit.com/dream ...
- Angularjs ui router,路由嵌套 父controller执行问题
解决方式来源:https://stackoverflow.com/questions/25316591/angularjs-ui-router-state-reload-child-state-onl ...
- AngularJS 使用 UI Router 实现表单向导
Today we will be using AngularJS and the great UI Router and the Angular ngAnimate module to create ...
- [转]AngularJS 使用 UI Router 实现表单向导
本文转自:http://www.oschina.net/translate/angularjs-multi-step-form-using-ui-router 今天我们将使用AngularJs和伟大的 ...
- angularjs ngRoute和ui.router对比
ngRoute模块是angularjs自带的路由模块,ui.router是一个第三方路由模块,接下来将对两者进行一个对比: ng-router(angular-router.js) ng-view n ...
- 【原创】ui.router源码解析
Angular系列文章之angular路由 路由(route),几乎所有的MVC(VM)框架都应该具有的特性,因为它是前端构建单页面应用(SPA)必不可少的组成部分. 那么,对于angular而言,它 ...
- ngRoute 与ui.router区别
angular路由 路由 (route) ,几乎所有的 MVC(VM) 框架都应该具有的特性,因为它是前端构建单页面应用 (SPA) 必不可少的组成部分. 那么,对于 angular 而言,它自然也有 ...
- ngRoute 和 ui.router 的使用方法和区别
在单页面应用中要把各个分散的视图给组织起来是通过路由机制来实现的.本文主要对 AngularJS 原生的 ngRoute 路由模块和第三方路由模块 ui.router 的用法进行简单介绍,并做一个对比 ...
- angularjs UI Libraries
angularjs UI Libraries ● ng-bootstrap is currently available. ● PrimeNG has largest number of compon ...
随机推荐
- vtk-py求3d模型表面积
模型格式:.obj 环境:python3.6+vtk7.1 vtk版: import vtk filename = "XXXX.obj" reader = vtk.vtkOBJRe ...
- Python中的可迭代对象
Python中的可迭代对象有:列表.元组.字典.字符串:常结合for循环使用: 判断一个对象是不是可迭代对象: from collections import Iterable isinstanc ...
- mysql死锁问题解决
1. 定位问题 http://blog.csdn.net/beiigang/article/details/43228361 2. 解决死锁 http://www.blogbus.com/ri0day ...
- City Game UVALive - 3029(悬线法求最大子矩阵)
题意:多组数据(国外题好像都这样),每次n*m矩形,F表示空地,R表示障碍 求最大子矩阵(悬线法模板) 把每个格子向上延伸的空格看做一条悬线 以le[i][j],re[i][j],up[i][j]分别 ...
- github 第三方登录
第三方登录先了解 OAuth 2.0 OAuth 协议的认证和授权的过程如下: 用户打开我的博客后,我想要通过GitHub获取改用户的基本信息 在转跳到GitHub的授权页面后,用户同意我获取他的基本 ...
- 邮件服务器启动postfix时的问题:master 已死,但 pid 文件仍存
[root@linux115 ~]# service postfix restart // 重启postfix关闭 postfix:[失败] 启动 postfix: [确定][root@linux ...
- ListItemType.AlternatingItem 和 ListItemType.Item
项目中后台绑定Reapter项时,判断 if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.Alte ...
- A. Minimizing the String
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
- 关于 java中的SecureRandom在linux中每次生成不同结果
使用AES算法的时候,会发现下面的代码在windows每次产生确定的结果,但Linux就不同,导致无法正确解密 public static String encrypt(String content, ...
- Thread.GetNamedDataSlot(String)
https://docs.microsoft.com/zh-cn/dotnet/api/system.threading.thread.getnameddataslot?redirectedfrom= ...