angular-ui-router state.go not passing data to $stateParams
app.js中定义了一个state如下,url接收一个id参数
$stateProvider.state("page.details", {
url: "/details/:id",
templateUrl: "home/index.html",
controller: "HomeCtrl",
controllerUrl: "home"
})
如果直接
$state.go('details');
将会显示state.go not passing data to $stateParams的错误信息,因为state的url中,已经规定需要传递一个id。
假如id没有值需要传递,如:
$state.go('details',{id:""});
假如需要传递id=1,如
$state.go('details',{id:1});
参考文献:
- state.go not passing data to $stateParams
- How to pass custom data in $state.go() in angular-ui-router?
- [ui-router \(stateProvider](https://ui-router.github.io/docs/0.3.1/#/api/ui.router.state.\)stateProvider#state)
angular-ui-router state.go not passing data to $stateParams的更多相关文章
- angular ui.router 路由传参数
angular已经用了一段时间了,最近在做路由,做一下笔记. 路由跳转的时候进行穿参 ui.router方式 <a ui-sref="edit({id:5})"> 编辑 ...
- 规范 : angular ui router path & params
在seo文章中提到url的path 必须是 why-us,而不是whyUS 所以定了规范,所有的path 必须why-us path ?后尾的是用来filter的,所以可以WhyUs 如果是不需要给s ...
- angular : $location & $state(UI router)的关系
次序:angular 的 location会先跑 $rootScope.$on("$locationChangeStart", function (scope, newUrl, o ...
- angular 的ui.router 定义不同的state 对应相同的url
Angular UI Router: Different states with same URL? The landing page of my app has two states: home-p ...
- [Angular 2 Router] Configure Your First Angular 2 Route
Using the Angular 2 router requires defining routes, passing them in to the RouterModule.forRoot and ...
- 【原创】ui.router源码解析
Angular系列文章之angular路由 路由(route),几乎所有的MVC(VM)框架都应该具有的特性,因为它是前端构建单页面应用(SPA)必不可少的组成部分. 那么,对于angular而言,它 ...
- ngRoute 与ui.router区别
angular路由 路由 (route) ,几乎所有的 MVC(VM) 框架都应该具有的特性,因为它是前端构建单页面应用 (SPA) 必不可少的组成部分. 那么,对于 angular 而言,它自然也有 ...
- 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和伟大的 ...
随机推荐
- 《Java程序员修炼之道》
原子类:java.util.concurrent.atomic 线程锁:java.util.concurrent.locks 对付死锁:boolean acquired = lock.tryLock( ...
- c++中从一段字符串中提取数字
采用标准输入输出: 输入:12&3 34*133^3131 13031* 输出:12 3 34 133 3131 13031 思路,先将整个输入存进一个字符串,再解析字符串,这样运行速度会 ...
- as自定义菜单。
与菜单相关的类一共有3个 ContextMenu类 ContextMenuBuiltInItems类 //与系统内置菜单相关的类 ContextMenuItem类 //与用户自定义菜单相关的类
- Linux环境下oracle创建和删除表空间及用户
#su - oracle $ sqlplus /nolog SQL> connect / as sysdba --//创建临时表空间 create temporary tablespace te ...
- 学习JQuery中文文档之get()函数
前端大神群的群主告诉我们:学习一个框架最好的方法是去把官方文档研究一遍. 现在正式开始我的前端之路,从JQuery的中文文档开始. 基础不牢固,看起来有点慢,但是我会一直坚持下去的.把遇到的问题都记录 ...
- 如何自学Java
转自:http://www.360doc.com/content/12/0624/19/5856897_220191533.shtml JAVA自学之路 JAVA自学之路 一:学会选择 为了就业, ...
- wpa_supplicant 移植及 linux 命令行模式配置无线上网
本文涉及内容为linux 命令行模式配置无线上网 及 wpa_supplicant 移植到开发板的过程,仅供参考. 1.源码下载 wpa_supplicant 源码下载地址 :http://hosta ...
- jQuery Mobile与QUI框架的异曲同工之处
最近一直在研究jQuery Mobile框架,这是jQuery的官方移动版UI框架,专门用来开发手机与平板电脑方面的应用.结果越来越觉得它和我的QUI框架的开发思路非常相似,很多地方都有异曲同工之妙. ...
- Codeforces Round #308 (Div. 2)B. Vanya and Books 数学
B. Vanya and Books Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/pr ...
- SharePoint 2013 中使用 JavaScript Like 和Unlike list item/page/document
SharePoint 2013中新增了很多社交功能,比如用户可以like/unlike 任何一个 list item/page/document,这是一个非常不错的功能. 但有时觉得like/unli ...