ionic頁面跳轉傳值 ng-click


  母頁:加入$state

<button  class="button button-calm button-block" ng-click="toProducer(producerId)" style="padding: 0 50px; background-color:#12B7F5;" >
 &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
</button>
ng-click="toProducer(producerId)"

母頁控制器:
 $scope.toProducer = function () {
         var tid = document.getElementById('taskid');
         var  TaskId = tid.textContent;
        $state.go('main.td', {producerId:TaskId});
        
    };
 
        

 APP.js

.state('main.td',{
    url:'/td/:producerId',
    views:{
        'main-kssb':{
           templateUrl: 'templates/kssb/td.html',
           controller: 'TbCtrl'
        }
    }
})

 

子頁控制器:$state $stateParams

 var TaskId = $stateParams.producerId;

$stateParams.producerId:獲取母頁傳入的值

 

 

 

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM