IonicPopup无法在Slidebox中运行?

时间:2015-12-22 19:17:52

标签: ionic ionicpopup

我有一个弹出脚本,可以使用简单的Ionic启动器。我正在使用Ionic Slidebox并尝试将其放入幻灯片(html模板),但是一旦我点击弹出窗口就无法使用。

我的index.html:

<ion-nav-view ng-controller="MainController"></ion-nav-view>
<script id="index.html" type="text/ng-template">
  <ion-view view-title="App name">
   <ion-content scroll="false">
 <ion-slide-box slide-tabs-scrollable="true"  show-pager="false" ion-slide-tabs>
<ion-slide ion-slide-tab-label="POP"><div ng-include src="'templates/poptest.html'"></div></ion-slide>
<ion-slide ion-slide-tab-label="MORE"><div ng-include src="'templates/more.html'"></div></ion-view></ion-slide>
</ion-slide-box>
</script>

我的&#34; poptest.html&#34;是基本布局(离子视图,离子含量,离子列表)。每个列表都有一个ng-click,可以触发我的一个控制器中的IonicPopup:

.controller(&#39; PopTestCtrl&#39;,功能($ scope,$ ionicPopup,Charge){

$ scope.status = {     loading:false,     消息:&#34;&#34;,   };

//为cause causedd捐款   $ scope.charge = function(causeId){

$scope.data = {}

var myPopup = $ionicPopup.show({
  template: '<input type="number" ng-model="data.amount" placeholder="Amount in USD">',
  title: 'How much?',
  subTitle: causeId,  // use causeHeaders for a more customized touch, i.e. $scope.causeHeaders[causeId]
  scope: $scope,
  buttons: [
    { text: 'Cancel' },
    {
      text: '<b>Next</b>',
      type: 'button-positive',
      onTap: function(e) {
        if (!$scope.data.amount) {
          //don't allow the user to close unless he enters wifi password
          e.preventDefault();
        } else {
          return $scope.data.amount;
        }
      }
    }
  ]
});
myPopup.then(function(amount) {
  console.log('Tapped!', amount);
  if(amount != undefined && amount != "" && amount != null) {
    startCharge(amount);
  }
  myPopup.close();
});

简而言之。

0 个答案:

没有答案