AngulaJS路由 ui-router 传递多个参数
定义路由:
.state(‘txnresult’, {
url: ‘/txnresult/:originAmount/:finalAmount/:currentPoint/:txnId/:discountAmount’,
templateUrl: ‘templates/txnresult.html’,
controller: ‘TxnResultCtrl’
})
基本参数:
‘/user/:id’
‘/user/{id}’
‘/user/{id:int}’
使用正则表达式:
‘/user/{id:[0-9]{1,8}’
//匹配所有以user开始的url 并将剩余参数传给id
‘/user/{id:.*}’
‘/user/*id
传递参数方式1:
href=”#/txnresult/{{originAmount}}/{{finalAmount}}/{{currentPoint}}/{{txnId}}/{{discountAmount}}”
传递参数方式2:
$state.Go(‘txnresult’,{originAmount: d.result.originAmount,finalAmount: d.result.finalAmount,currentPoint: d.result.currentPoint,txnId: d.result.txnId,discountAmount: d.result.discountAmount});
获取参数:
$scope.originAmount = $stateParams.originAmount;
$scope.finalAmount = $stateParams.finalAmount;
$scope.currentPoint = $stateParams.currentPoint;
$scope.discountAmount = $stateParams.discountAmount;
$scope.txnId = $stateParams.txnId;
AngulaJS路由 ui-router 传递多个参数的更多相关文章
- angularjs的路由ui.router
<!-- 引入路由插件 --> <script src="vendor/angular-ui-router/release/angular-ui-router.min. ...
- element ui change 传递带自定义参数
@change="((val)=>{changeStatus(val, index)})" https://www.cnblogs.com/mmzuo-798/p/10438 ...
- angular ui.router 路由传参数
angular已经用了一段时间了,最近在做路由,做一下笔记. 路由跳转的时候进行穿参 ui.router方式 <a ui-sref="edit({id:5})"> 编辑 ...
- vue 中 this.$router.push() 路由跳转传参 及 参数接收的方法
传递参数的方法:1.Params 由于动态路由也是传递params的,所以在 this.$router.push() 方法中 path不能和params一起使用,否则params将无效.需要用name ...
- Vue编程式路由跳转传递参数
Vue 有时在路由跳转时需要用到一些原页面里的数据,用以下方法: 1.在跳转页的方法里写下query参数 TableChange(scope){ this.$router.push({ path:'d ...
- Django路由系统---django重点之url传递一个默认参数
django重点之url传递一个默认参数 可以利用这个特性,让2个URL映射一个函数,但是返回2个不同的HTML url(r'default_param1', views.def_param,), u ...
- angular路由——ui.route
angular路由 使用案例 <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...
- 【原创】ui.router源码解析
Angular系列文章之angular路由 路由(route),几乎所有的MVC(VM)框架都应该具有的特性,因为它是前端构建单页面应用(SPA)必不可少的组成部分. 那么,对于angular而言,它 ...
- angular 4 router传递数据三种方法
1.在查询参数中传递数据 <a [routerLink]="['/product']" [queryParams]="{id:1,name:'dongian'}& ...
- ngRoute 与ui.router区别
angular路由 路由 (route) ,几乎所有的 MVC(VM) 框架都应该具有的特性,因为它是前端构建单页面应用 (SPA) 必不可少的组成部分. 那么,对于 angular 而言,它自然也有 ...
随机推荐
- IIS发布问题汇总
1.未能加载文件或程序集“System.Data.SQLite” 在IIS界面选择应用程序池->选择所使用的.net 版本->高级设置->将"使用32位应用程序" ...
- Spring框架的XML扩展特性
Spring框架从2.0版本开始,提供了基于Schema风格的XML扩展机制,允许开发者扩展spring配置文件.现在我们来看下怎么实现这个功能,可以参考spring帮助文档中的<Extensi ...
- .net 环境下get 获取页面出现乱码问题解决
不多说了,先上代码: /// <summary> /// 获取页面内容 /// </summary> /// <param name="Url"> ...
- WEB打印控件Lodop
主页 http://www.lodop.net/
- .Net中的泛型(where T : class的含义)
Eg: class A<T>where T:new() where表明了对类型变量T的约束关系.where T: A表示类型变量是继承于A的,或者是A本身.where T:new()指明了 ...
- EF文章连接
http://www.cnblogs.com/shanyou/archive/2011/07/17/2108953.html http://www.cnblogs.com/haogj/archive/ ...
- Java 2D API - 2. Graphics 入门
Java 2D API强大而复杂,不过大多时候我们只需使用java.awt.Graphcis类的部分功能.下面的内容将覆盖大多数的常见应用. Graphics 类中的方法大致可以分为两类: Draw ...
- 关于ckeditor 第二次加载 出现问题
在使用ckeditor 出现的问题也比较多的 ,一个问题是图片上传的问题 ,一个就是第二次加载的时候 ckeditor编辑框出现不了的问题 第一个问题 是修改ckeditor js属性 网上都有 第 ...
- ES6新特性之模板字符串
ES6新特性概览 http://www.cnblogs.com/Wayou/p/es6_new_features.html 深入浅出ES6(四):模板字符串 http://www.infoq.c ...
- 分拆素数和 HDU - 2098
把一个偶数拆成两个不同素数的和,有几种拆法呢? Input输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束.Output对应每个偶数,输出其拆成不同素数的个数,每个结果 ...