0

我是离子的初学者。我只是尝试使用 ionic 实现帐户工具包身份验证,但我总是收到此错误

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:nomod] Module 'starter' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 

以及如何使用 Ionic 框架实现帐户工具包的最佳实践?

这是我的app.js

angular.module('starter', ['ionic', 'starter.services', 'firebase', 'AccountKit'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);

    }
    if (window.StatusBar) {
      StatusBar.styleDefault();
    }
  })
})

// Start of Controller

.controller('LoginCtrl', function($scope){
  // initialize Account Kit with CSRF protection
  $scope.AccountKit_OnInteractive = function(response){
  AccountKit.init({
      appId:'secret', 
      state:"secret", 
      version:"v1.1"
  })
 }
})

.controller('DashCtrl', function($scope) {})

.controller('ChatsCtrl', function($scope, Chats) {
  $scope.chats = Chats.all();
  $scope.remove = function(chat) {
    Chats.remove(chat);
  };
})

.controller('ChatDetailCtrl', function($scope, $stateParams, Chats) {
   $scope.chat = Chats.get($stateParams.chatId);
})

.controller('AccountCtrl', function($scope) {
   $scope.settings = {
   enableFriends: true
   };
});

// End of Controller

// Start Routing

.config(function($stateProvider, $urlRouterProvider) {
  $stateProvider

  .state('login', {
    url: '/login',
    templateUrl: 'templates/login.html',
    controller: 'LoginCtrl'
  })

  // setup an abstract state for the tabs directive
  .state('tab', {
      url: '/tab',
      abstract: true,
      templateUrl: 'templates/tabs.html'
  })

  // Each tab has its own nav history stack:

 .state('tab.dash', {
      url: '/dash',
      views: {
         'tab-dash': {
         templateUrl: 'templates/tab-dash.html',
         controller: 'DashCtrl'
         }
      }
  })

 .state('tab.chats', {
     url: '/chats',
     views: {
    'tab-chats': {
         templateUrl: 'templates/tab-chats.html',
         controller: 'ChatsCtrl'
     }
   }
})
.state('tab.chat-detail', {
  url: '/chats/:chatId',
  views: {
    'tab-chats': {
      templateUrl: 'templates/chat-detail.html',
      controller: 'ChatDetailCtrl'
    }
  }
})

  .state('tab.account', {
    url: '/account',
    views: {
      'tab-account': {
        templateUrl: 'templates/tab-account.html',
        controller: 'AccountCtrl'
      }
    }
  })

   // if none of the above states are matched, use this as the fallback
   $urlRouterProvider.otherwise('/login');

});

// End of Routing

// Initialize Firebase
var config = {
  apiKey: "secret",
  authDomain: "secret",
  databaseURL: "secret",
  storageBucket: "secret",
  messagingSenderId: "secret"
};
firebase.initializeApp(config);
4

0 回答 0