zoukankan      html  css  js  c++  java
  • 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:获取母页传入的值

     
  • 相关阅读:
    synchronized的原理
    ThreadLocal是什么?使用场景有哪些?
    什么是死锁?死锁产生的原因?
    15-错误
    14-异常处理
    13-接口
    12-方法
    11-结构体
    10-指针
    09-字符串
  • 原文地址:https://www.cnblogs.com/zry2510/p/6130602.html
Copyright © 2011-2022 走看看