Ionic typeerror:'null'不是对象(评估'content.offsetx')

时间:2015-03-24 19:02:02

标签: angularjs ionic-framework ionic

当我使用ios 7在我的iphone 4上运行我的离子/角度移动应用程序时,当我点击侧面菜单中的导航链接时,我会收到此错误,并阻止其他应用程序运行

typeerror:'null'不是对象(评估'content.offsetx')

有没有人以前得到过这个?

继承了一些代码,但我不确定它是否会有所帮助

// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic',  'starter.controllers', 'arvak.forms', 'angular-locker', 'ngSlider', 'arvak.configs', 'widgets.camera', 'widgets.signature', 'ngCordova', 'widgets.barcodeScanner' ])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
    //iOS 8 bug
    //http://forum.ionicframework.com/t/click-a-input-field-whole-app-jumps-down-and-back-to-the-original-place/10876/15
    if(window.cordova && window.cordova.plugins.Keyboard) {
       window.cordova.plugins.Keyboard.disableScroll(true);
    }

  });
})

.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
  //$locationProvider.html5Mode(true);

    //$urlRouterProvider.when('', '/');

  $stateProvider

      .state('index', {
        url: '/',
        templateUrl: 'index.html'
      })

      .state('app', {
        url: "/app",
        abstract: true,
        templateUrl: "templates/menu.html",
        controller: 'AppCtrl'
      })

      .state('app.search', {
        url: "/search",
        views: {
          'menuContent': {
            templateUrl: "templates/search.html",
            controller: 'SearchController'
          }
        }
      })
      .state('app.form', {
        url: "/forms",
        views: {
          'menuContent': {
            templateUrl: "js/forms/templates/forms/formWrapper.html",
            controller: 'FormsController'
          }
        }
      })

      .state('app.browse', {
        url: "/browse",
        views: {
          'menuContent': {
            templateUrl: "templates/browse.html",
            controller: 'BrowseController'
          }
        }
      })
        .state('app.playlists', {
          url: "/playlists",
          views: {
            'menuContent': {
              templateUrl: "templates/playlists.html",
              controller: 'PlaylistsCtrl'
            }
          }
        })

      .state('app.single', {
        url: "/playlists/:playlistId",
        views: {
          'menuContent': {
            templateUrl: "templates/playlist.html",
            controller: 'PlaylistCtrl'
          }
        }
      })
      .state('app.camera', {
          url: "/camera",
          views: {
              'menuContent': {
                  templateUrl: "templates/camera.html"
                  //controller: 'CameraControler'
              }
          }
      })

        .state('app.signature', {
            url: "/signature",
            views: {
                'menuContent': {
                    templateUrl: "templates/signature.html"
                    //controller: 'CameraControler'
                }
            }
        })

      .state('app.barcode', {
          url: "/barcode",
          views: {
              'menuContent': {
                  templateUrl: "templates/barcode.html"
                  //controller: 'CameraControler'
              }
          }
      });

  // if none of the above states are matched, use this as the fallback
  $urlRouterProvider.otherwise('/app/forms');
});
<ion-side-menus enable-menu-with-back-views="false">
  <ion-side-menu-content>
    <ion-nav-bar class="bar-stable">
      <ion-nav-back-button>
      </ion-nav-back-button>

      <ion-nav-buttons side="left">
        <button class="button button-icon button-clear ion-navicon" menu-toggle="left">
        </button>
      </ion-nav-buttons>
    </ion-nav-bar>
    <ion-nav-view name="menuContent"></ion-nav-view>
  </ion-side-menu-content>

  <ion-side-menu side="left">
    <ion-header-bar class="bar-stable">
      <h1 class="title">Left</h1>
    </ion-header-bar>
    <ion-content>
      <ion-list>
        <ion-item nav-clear menu-close ng-click="login()">
          Login
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/search">
          Search
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/forms">
          Form
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/playlists">
          Tasks
        </ion-item>
          <ion-item nav-clear menu-close href="#/app/camera">
              Camera
          </ion-item>
          <ion-item nav-clear menu-close href="#/app/signature">
              signature
          </ion-item>
          <ion-item nav-clear menu-close href="#/app/barcode">
              barcode scanner
          </ion-item>
      </ion-list>
    </ion-content>
  </ion-side-menu>
</ion-side-menus>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="lib/ng-slider/css/ng-slider.min.css" rel="stylesheet">
    
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

 

    <script src="lib/jquery/jquery-1.11.2.min.js"></script>
    <script src="lib/angular-locker.js"></script>
    <script src="lib/angular.ng-modules.js"></script>
    <script src="lib/cross-storage/client.js"></script>
    <script src="lib/lodash/lodash.js"></script>
    <script src="lib/moment/moment.js"></script>
    <script src="lib/bootstrap/dateTimePicker.js"></script>
    <script src="lib/ng-slider/js/ng-slider.min.js"></script>

      <!-- bower installs -->
      <script src="lib/ng-cordova.min.js"></script>
      <script src="lib/signature_pad.min.js"></script>

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/configs/configs.js"></script>
    <script src="js/forms/forms.js"></script>
    <script src="js/forms/directives/formDirective.js"></script>
    <script src="js/forms/directives/fieldDirective.js"></script>
    <script src="js/forms/directives/fields/fancySelect.js"></script>
    <script src="js/forms/directives/validation/validationDirectives.js"></script>
    <script src="js/forms/directives/validation/maxLengthValidator.js"></script>
      <script src="js/common/directives/signatureDirective.js"></script>

    <script src="js/forms/directives/sections/formSection.js"></script>
    <script src="js/forms/services/formsService.js"></script>
    <script src="js/forms/controllers/formsController.js"></script>
      <script src="js/common/directives/cameraDirective.js"></script>
      <script src="js/common/controllers/cameraController.js"></script>
      <script src="js/common/controllers/signatureController.js"></script>
      <script src="js/common/controllers/barcodeController.js"></script>
    
    <!-- BMA: This has to be last script! -->
    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

  </head>

  <body ng-app="starter">
     <ion-nav-view class="slide-left-right"></ion-nav-view>
  </body>
</html>

0 个答案:

没有答案