案例:ionic案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html ng-app="ionicApp">
2
  <head>
3
    <meta charset="utf-8">
4
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
5
    <title>W3xue教程(w3xue.com)</title>
6
    <link href="https://cdn.bootcss.com/ionic/1.3.2/css/ionic.css" rel="stylesheet">
7
    <script src="https://cdn.bootcss.com/ionic/1.3.2/js/ionic.bundle.min.js"></script>
8
    <script type="text/javascript">
9
      angular.module('ionicApp', ['ionic'])
10
11
      .controller('RootCtrl', function($scope) {
12
        $scope.onControllerChanged = function(oldController, oldIndex, newController, newIndex) {
13
          console.log('Controller changed', oldController, oldIndex, newController, newIndex);
14
          console.log(arguments);
15
        };
16
      })
17
18
19
      .controller('HomeCtrl', function($scope, $timeout, $ionicModal, $ionicActionSheet) {
20
        $scope.items = [];
21
22
        $ionicModal.fromTemplateUrl('newTask.html', function(modal) {
23
          $scope.settingsModal = modal;
24
        });
25
26
        var removeItem = function(item, button) {
27
          $ionicActionSheet.show({
28
            buttons: [],
29
            destructiveText: 'Delete Task',
30
            cancelText: 'Cancel',
31
            cancel: function() {
32
              return true;
33
            },
34
            destructiveButtonClicked: function() {
35
              $scope.items.splice($scope.items.indexOf(item), 1);
36
              return true;
37
            }
38
          });
39
        };
40
41
        var completeItem = function(item, button) {
42
          item.isCompleted = true;
43
        };
44
45
        $scope.onReorder = function(el, start, end) {
46
          ionic.Utils.arrayMove($scope.items, start, end);
47
        };
48