首页 > 技术文章 > ionic1页面间传递参数的问题

liaolei1 2017-07-25 17:12 原文

1.  $scope.routeinfo是我要传递的参数--到scheddulcontent这个页面去:

   $state.go( "scheddulcontent" , { 'routeinfo' : $scope.routeinfo } ) ;

2.接收参数的页面:需要注入:$stateParams

        获取参数:$scope.info=$stateParams.routeinfo;

3.路由的设置(在接收参数的页面设置):

.state('scheddulcontent', {
  url: '/scheddulcontent',
  templateUrl: 'templates/commonusefunction/operating/show_route.html',
  resolve: load([
   'js/services/commonusefunction/operatingFactory.js',
   'js/controllers/commonusefunction/operating/show_routeController.js'
  ]),
  params: {'routeinfo': null}
 })

 

推荐阅读