Ionic 警告框

<html ng-app="mySuperApp">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
        <title>Alert</title>
        <link href="http://www.runoob.com/static/ionic/css/ionic.min.css" rel="stylesheet">
        <script src="http://www.runoob.com/static/ionic/js/ionic.bundle.min.js"></script>
        <script type="text/javascript">
        angular.module('mySuperApp', ['ionic'])
        .controller('PopupCtrl',function($scope, $ionicPopup, $timeout) {
           //  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');
             });
           };
        });
      </script>
    </head>
    <body class="padding" ng-controller="PopupCtrl">
      <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>
</html>

  

posted @ 2016-10-17 13:24  墨纸瀚云  阅读(1118)  评论(0编辑  收藏  举报