多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

中國最全IT社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2

ionic教程

ionic 對話框

閱讀 (2200)

ionic 對話框


$ionicPopup

ionic 對話框服務允許程序創(chuàng)建、顯示彈出窗口。

$ionicPopup 提供了3個方法:alert(), prompt(),以及 confirm() 。

實例

HTML 代碼

<body class="padding" ng-controller="PopupCtrl">
	<button class="button button-dark" ng-click="showPopup()">
	  彈窗顯示
	</button>
	<button class="button button-primary" ng-click="showConfirm()">
	  確認對話框
	</button>
	<button class="button button-positive" ng-click="showAlert()">
	  警告框
	</button>

	<script id="popup-template.html" type="text/ng-template">
	  <input ng-model="data.wifi" type="text" placeholder="Password">
	</script>
</body>

JavaScript 代碼

angular.module('mySuperApp', ['ionic'])
.controller('PopupCtrl',function($scope, $ionicPopup, $timeout) {

 // Triggered on a button click, or some other target
 $scope.showPopup = function() {
   $scope.data = {}

   // 自定義彈窗
   var myPopup = $ionicPopup.show({
     template: '<input type="password" ng-model="data.wifi">',
     title: 'Enter Wi-Fi Password',
     subTitle: 'Please use normal things',
     scope: $scope,
     buttons: [
       { text: 'Cancel' },
       {
         text: '<b>Save</b>',
         type: 'button-positive',
         onTap: function(e) {
           if (!$scope.data.wifi) {
             // 不允許用戶關(guān)閉,除非輸入 wifi 密碼
             e.preventDefault();
           } else {
             return $scope.data.wifi;
           }
         }
       },
     ]
   });
   myPopup.then(function(res) {
     console.log('Tapped!', res);
   });
   $timeout(function() {
      myPopup.close(); // 3秒后關(guān)閉彈窗
   }, 3000);
  };
   //  confirm 對話框
   $scope.showConfirm = function() {
     var confirmPopup = $ionicPopup.confirm({
       title: 'Consume Ice Cream',
       template: 'Are you sure you want to eat this ice cream?'
     });
     confirmPopup.then(function(res) {
       if(res) {
         console.log('You are sure');
       } else {
         console.log('You are not sure');
       }
     });
   };

   //  alert(警告) 對話框
   $scope.showAlert = function() {
     var alertPopup = $ionicPopup.alert({
       title: 'Don\'t eat that!',
       template: 'It might taste good'
     });
     alertPopup.then(function(res) {
       console.log('Thank you for not eating my delicious ice cream cone');
     });
   };
});

嘗試一下 ?

關(guān)閉
程序員人生
主站蜘蛛池模板: 精彩视频一区二区三区 | 视频h在线 | 印度free xxxx性农村 | 爱爱小视频免费体验区在线观看 | 一级做a爰性视频 | yellow中文字幕官网是 | 欧美高清在线不卡免费观看 | 在线18av| xx视频在线| 国产成人免费视频 | 性色a∨人人爽网站 | 国产激情一区二区三区 | 综合亚洲色图 | 亚洲视频自拍 | 欧美一级精品 | 龙口护士门91午夜国产在线 | 精品成人久久 | 国产亚洲高清在线精品不卡 | 亚洲国产爱 | 波多野结衣久久国产精品 | 日韩中文字幕视频在线 | 在线碰碰视频在线观看 | 国产在线播放不卡 | 国产成人免费a在线资源 | 一区二区三区四区视频 | 最近的中文字幕视频大全高清 | 亚洲天堂高清 | 12306午夜被窝播播影院yw188 | 欧美极品尤物在线播放一级 | 国产护士资源总站 | 三级做爰大爽长视频在线观看 | 国产精品成人久久久久 | 自拍偷拍亚洲 | 久久艹免费视频 | 性久久久久久久久 | 另类二区 | 亚洲欧美视频网站 | 天堂在线影院 | 欧美一级在线全免费 | 久久精品国产网红主播图片 | 日韩欧美一中文字幕不卡 |