angular-ui-router state.go not passing data to $stateParams
2016-10-21 00:22
393 查看
app.js中定义了一个state如下,url接收一个id参数
如果直接
将会显示
假如id没有值需要传递,如:
假如需要传递id=1,如
How to pass custom data in $state.go() in angular-ui-router?
ui-router $stateProvider
$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 $stateParamsHow to pass custom data in $state.go() in angular-ui-router?
ui-router $stateProvider
相关文章推荐
- [Angular 2] Passing data to components with @Input
- angular-ui-router中的$stateProvider设置
- URL-encoded form data is not valid ,Operation is not valid due to the current state of the object
- [Angular 2] Passing data to components with @Input
- [Angular-Scaled web] 5. ui-router $stateParams for sharing information
- angular 的ui.router 定义不同的state 对应相同的url
- 【ionic+angularjs】angularjs ui-router路由简介($urlRouter、$state、$stateProvider、ui-sref....)
- A Better $state.reload for the AngularJS UI-Router
- Configuration data download to FPGA was not successful. DONE did not go high, please check your con
- - Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.
- AngularJS路由之ui-router(四)$state.go页面跳转
- System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException: Operation is not valid due to the current state of the obj
- Unity3D使用Animator报:"Animator.GotoState: State could not be found invalid layer index"错误解决方
- angular的uiRouter服务学习(5) --- $state.includes()方法
- 【ionic+angularjs】angularjs ui-router路由简介($urlRouter、$state、$stateProvider、ui-sref....)
- KendoUI how to use local data, not form url
- angular的uiRouter服务学习(5) --- $state.includes()方法
- Passing Data to Subroutines
- Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)
- Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)