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和伟大的 ...
随机推荐
- Extjs随笔
{ columnWidth : .1, layout : 'form', items : [{ fieldLabel : "至", labelSeparator:'', label ...
- CMSIS Example - osTimer osTimerCreate osTimerStart
osTimerId timer; uint32_t cnt=; void timerHandler( void * arg ) { cnt++; osTimerStart( timer, ); } o ...
- UDT: Breaking the Data Transfer Bottleneck
http://udt.sourceforge.net/ DT is a reliable UDP based application level data transport protocol for ...
- 响应式的dribbble作品集魔术布局展示效果
在线演示1 本地下载 相信做设计的朋友肯定都知道dribbble.com,它是一个非常棒的设计师分享作品的网站,全世界数以万计的设计高手和行家都在这个网站上分享自己的作品,当然,如果你常在上面闲逛的话 ...
- Lazy Loading Images
Use a blank.gif as the src of images, and include the width and height of the final image. HTML: < ...
- registerClassAlias()函数和getClassByAlias()函数
flash.net 包中包含包级函数,可用于打开新的浏览器窗口,向服务器发送 URL 请求以及处理类别名. registerClassAlias()函数 public function registe ...
- oracle存储过程实例
oracle存储过程实例 分类: 数据(仓)库及处理 2010-05-03 17:15 1055人阅读 评论(2)收藏 举报 认识存储过程和函数 存储过程和函数也是一种PL/SQL块,是存入数据库的P ...
- C#类的成员初始化顺序
首先我们来看看引用类型的成员初始化过程 我们来看一个例子吧 class Program { static void Main(string[] args) { Driv ...
- Nginx_handler模块发开(hello模块结构解析)
声明:请在文章页面明显位置给出原文连接 http://www.cnblogs.com/paulweihan/p/4654173.html,否则保留追究法律责任的权利. 近期查了非常多资料.入门的样例都 ...
- android复制数据库到SD卡(网上搜集,未经验证)
android中使用sqlite.复制assets下的数据库到SD卡.支持大于1M的文件 如果使用SD卡,需要在AndroidManifest.xml中设置权限 <uses-permission ...