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和伟大的 ...
随机推荐
- 移动端轮播图插件(支持Zepto和jQuery)
一. 效果图 二. 功能介绍 1. 支持图片自动轮播和非自动轮播 2. 支持点击和滑动. 三. 简单介绍 代码都有注释,逻辑简单,不做更多赘述. 1. 在你的html中添加一行. <sectio ...
- js 数组去重 的5种方法
一万数组,4个重复项,先贴上成绩. 1.3毫秒 2.115毫秒 3.71毫秒 4.6毫秒 1.哈希表 2.JQuery (最快的方法是用JQuery 这句话是截图带的... 实际上Jq是最慢的) 3. ...
- 直接运行PowerShell脚本
以管理员权限运行下面语句:ftype Microsoft.PowerShellScript.1="C:\WINDOWS\system32\windowspowershell\v1.0\pow ...
- UIImage imageNamed 与 imageWithContentsOfFile的差别
[UIImage imageNamed:]仅仅适合与UI界面中的贴图的读取,较大的资源文件应该尽量避免使用 用UIImage载入本地图像最经常使用的是以下三种: 1.用imageNamed方法 [UI ...
- 「译」JavaScript 的怪癖 1:隐式类型转换
原文:JavaScript quirk 1: implicit conversion of values 译文:「译」JavaScript 的怪癖 1:隐式类型转换 译者:justjavac 零:提要 ...
- Looksery Cup 2015 H. Degenerate Matrix 数学
H. Degenerate Matrix Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/549/ ...
- 支付宝api指南
tyle="margin:20px 0px 0px; line-height:26px; font-family:Arial"> 在这些服务中,服务类型大致可以分为以下几类: ...
- 次表面散射(SubSurface Scattering) Shader 【转】
原文 http://www.azure.com.cn/article.asp?id=231 用深度值近似模拟物体的厚度,厚度越小处透光越多. varying vec4 position;varying ...
- [Angular 2] Order Dynamic Components Inside an Angular 2 ViewContainer
By default, when you generate components, they will simply be added to the page in order, one after ...
- 关于android的屏幕保持常亮
实现这一功能的方法有两种,一种是在Manifest.xml文件里面声明,一种是在代码里面修改LayoutParams的标志位.具体如下: 1.在Manifest.xml文件里面用user-permis ...