angular.js 页面之间传递多个参数

路由:

1
2
3
4
5
6
.state('dash_list', {
cache: false,
url: '/dash_list/:stock/:no',
templateUrl: 'templates/dash-list.html',
controller: 'DashListCtrl'
})

controller写法
//去查询结果页面

1
2
3
4
$scope.toDashList = () {

$state.go('dash_list',{stock:"仓库1号",no:"鄂B:0000001"});
};

接收controller写法
//发运单查询结果

1
2
3
4
5
6
7
8
9
10
11
    .controller('DashListCtrl', function($scope,$stateParams,$ionicHistory, $timeout, $ionicLoading, $ionicScrollDelegate) {

$scope.back = () {
$ionicHistory.goBack();
//返回上一页
};

var stock = $stateParams.stock;
var no = $stateParams.no;
//alert(stock+"-"+no);
});