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 ...
随机推荐
- eclipse - 链接hadoop
插件: 配置:Map/Reduce Location 问题:An internal error occurred during: "Map/Reduce location status up ...
- Codeforces Round #541 (Div. 2)D(并查集(dsu),拓扑排序)
#include<bits/stdc++.h>using namespace std;vector<int>g[2007];int fa[2007],vis[2007],num ...
- atcoder/CODE FESTIVAL 2017 qual B/B(dfs染色判断是否为二分图)
题目链接:http://code-festival-2017-qualb.contest.atcoder.jp/tasks/code_festival_2017_qualb_c 题意:给出一个含 n ...
- js初识
01-Javascript简介 Web前端有三层: HTML:从语义的角度,描述页面结构 CSS:从审美的角度,描述样式(美化页面) JavaScript:从交互的角度,描述行为(提升用户体验) ...
- 解决vue-cli相对路径问题 about css assert path ,two Solution(css路径的问题解决方案) #179
https://github.com/vuejs/vue-cli/issues/179
- 基本css拼图形
关闭按钮: <em class="close"></em> .close { width: 16px; height: 16px; text-align: ...
- clang -O3 for循环的LLVM IR
O3都是怪物,这里分析的是CLANG怪物,示例程序遍历数组每个元素然后放大. void foreach_scale(int arr[],int elem){ for(int i=0;i<elem ...
- 14.Diameter of Binary Tree(二叉树的直径)
Level: Easy 题目描述: Given a binary tree, you need to compute the length of the diameter of the tree. ...
- 合并queryset
今天在实现搜索时遇到一个问题,如何同时搜索model里面的title以及content和category字典 contents = Blog.objects.filter(content__conta ...
- ssh免密登录linux服务器
Ssh免密登录 sshd服务 sshd简介: SSH 密钥为登录 Linux 服务器提供了更好且安全的机制.运行 ssh-keygen 后,将会生成公私密钥对.你可以将公钥放置到任意服务器,从持有私钥 ...