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});

参考文献:

  1. state.go not passing data to $stateParams
  2. How to pass custom data in $state.go() in angular-ui-router?
  3. [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的更多相关文章

  1. angular ui.router 路由传参数

    angular已经用了一段时间了,最近在做路由,做一下笔记. 路由跳转的时候进行穿参 ui.router方式 <a ui-sref="edit({id:5})"> 编辑 ...

  2. 规范 : angular ui router path & params

    在seo文章中提到url的path 必须是 why-us,而不是whyUS 所以定了规范,所有的path 必须why-us path ?后尾的是用来filter的,所以可以WhyUs 如果是不需要给s ...

  3. angular : $location & $state(UI router)的关系

    次序:angular 的 location会先跑 $rootScope.$on("$locationChangeStart", function (scope, newUrl, o ...

  4. angular 的ui.router 定义不同的state 对应相同的url

    Angular UI Router: Different states with same URL? The landing page of my app has two states: home-p ...

  5. [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 ...

  6. 【原创】ui.router源码解析

    Angular系列文章之angular路由 路由(route),几乎所有的MVC(VM)框架都应该具有的特性,因为它是前端构建单页面应用(SPA)必不可少的组成部分. 那么,对于angular而言,它 ...

  7. ngRoute 与ui.router区别

    angular路由 路由 (route) ,几乎所有的 MVC(VM) 框架都应该具有的特性,因为它是前端构建单页面应用 (SPA) 必不可少的组成部分. 那么,对于 angular 而言,它自然也有 ...

  8. AngularJS 使用 UI Router 实现表单向导

    Today we will be using AngularJS and the great UI Router and the Angular ngAnimate module to create ...

  9. [转]AngularJS 使用 UI Router 实现表单向导

    本文转自:http://www.oschina.net/translate/angularjs-multi-step-form-using-ui-router 今天我们将使用AngularJs和伟大的 ...

随机推荐

  1. NotePad++ 列模式(在多行开头统一添加相同内容)

    ==> 按住Alt键不放,用鼠标左键从第一行的开头处按住向下拉,直到所有行 松开Alt键和鼠标左键,你会发现光标变成了一条跨越所有行的竖线 ==> 如果不想使用鼠标操作,可以使用 Alt+ ...

  2. [转]window10系统安装oracle11g时遇到INS-13001环境不满足最低要求

    window10系统安装oracle11g时遇到INS-13001环境不满足最低要求 机器安装了window10系统,之前有次安装oracle11g是成功了.但是机器后来固态硬盘坏了,又坏了个后,还是 ...

  3. 新建VM_Script

    在Hyper-V群集中,不需要设置VM的自启动,当宿主机意外关机重新启动后,上面的VM会自动转移到另一台主机:如果另一台主机处于关机状态,则宿主机重新启动后,其VM也会自启动(如果其VM在宿主机关机前 ...

  4. ibatis基本内容简介

    iBATIS一词来源于“internet”和“abatis”的组合,是一个由Clinton Begin在2002年发起的开放源代码项目.于2010年6月16号被 谷歌托管,改名为MyBatis.是一个 ...

  5. scu 4436: Easy Math 水题

    4436: Easy Math Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.scu.edu.cn/soj/problem.actio ...

  6. OSG中找到特定节点的方法(转)

    OSG中找到特定节点的方法 为了在OSG中找到需要的节点并对节点做出相应的操作,可以从NodeVisitor类中继承一个类,NPS的教程 [download id="14"] 阐述 ...

  7. phpmyadmi 上传大文件

    最近自己想通过phpmyadmin上传大的文件,找了很多方法都没搞定,今天特意静下心来,终于搞定了. 需求:将480M大小的sql文件通过phpmyadmin进行导入 1.首先修改php.ini文件, ...

  8. [ES6] 15. Generators -- 2

    Using for..of statement: function* greeting(){ console.log(`Generators are "lazy"`); yield ...

  9. sun.misc.BASE64Encoder和sun.misc.BASE64Encoder 找不到解决的方法

    1.右键项目->属性->java bulid path->jre System Library->access rules->resolution选择accessible ...

  10. linux服务器之redis

    linux环境下安装redis服务器: redis下载地址:http://redis.io/download $ wget http://download.redis.io/releases/redi ...