首页 > 代码库 > ionic ng-repeat 循环传值

ionic ng-repeat 循环传值

 

母页

<div class="list" style="color:#676767; font-size: 16px; letter-spacing: 2px;" ng-repeat="x in shuju">



  <a class="item" ui-sref="main.zgxc-xqxx({TaskNo:x.TaskNo,TaskId:x.TaskId})">
    案件编号:<span>{{x.TaskNo}}</span>
  <span hidden="true">{{x.TaskId}}</span>
  </a>
 
   
</div>
   

母页数据源

    $scope.$apply(function(){
                  $scope.shuju=Data.list;
              });

APP.JS

 .state(‘main.zgxc-xqxx‘, {
    url: ‘/zgxc-xqxx/:TaskNo:TaskId‘,
    views: {
        ‘main-zgxc‘: {
          templateUrl: ‘templates/zgxc/zgxc-xqxx.html‘,
           controller:‘Ktxtrl‘
        }
    }
    
  })

子页控制器 接收参数

angular.module(‘starter‘)
.controller(‘Ktxtrl‘, function($scope, $state, $http, $ionicPopup, AuthService,$ionicModal,$stateParams) {

 var TaskId = $stateParams.TaskId;
 var TaskNo = $stateParams.TaskNo;
 $scope.taskno=TaskNo;

});

 

ionic ng-repeat 循环传值