Javascript 未捕获错误:[$injector:modulerr]未能实例化模块启动器,原因是:错误:[$injector:modulerr]

Javascript 未捕获错误:[$injector:modulerr]未能实例化模块启动器,原因是:错误:[$injector:modulerr],javascript,angularjs,ionic-framework,Javascript,Angularjs,Ionic Framework,我知道这很简单,但我已经试了几个小时,看不出是什么。这是我的作品:` <!-- ionic/angularjs js --> <script src="lib/ionic/js/ionic.bundle.js"></script> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, w

我知道这很简单,但我已经试了几个小时,看不出是什么。这是我的作品:`

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<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="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">
-->



<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

<!-- your app's js -->
<script src="js/app.js"></script>

以下是应用程序文件的内容:

    // 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.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])

.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 && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);

    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
  });
})

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

  // Ionic uses AngularUI Router which uses the concept of states
  // Learn more here: https://github.com/angular-ui/ui-router
  // Set up the various states which the app can be in.
  // Each state's controller can be found in controllers.js
  $stateProvider

  // 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('/tab/dash');

});
//Ionic Starter应用程序
//angular.module是创建、注册和检索angular模块的全局位置
//“starter”是此角度模块示例的名称(也在index.html中的属性中设置)
//第二个参数是“requires”的数组
//可以在services.js中找到“starter.services”
//可以在controllers.js中找到“starter.controllers”
angular.module('starter'、['ionic'、'starter.Controller'、'starter.services']))
.run(函数($ionicPlatform){
$ionicPlatform.ready(函数(){
//默认情况下隐藏附件栏(删除此选项可在键盘上方显示附件栏)
//表格输入)
if(window.cordova&&window.cordova.plugins&&window.cordova.plugins.Keyboard){
插件键盘hideKeyboardAccessoryBar(真);
插件。键盘。禁用滚动(真);
}
如果(窗口状态栏){
//需要org.apache.cordova.statusbar
StatusBar.styleDefault();
}
});
})
.config(函数($stateProvider,$urlRouterProvider){
//Ionic使用AngularUI路由器,它使用状态的概念
//在此处了解更多信息:https://github.com/angular-ui/ui-router
//设置应用程序可以处于的各种状态。
//每个州的控制器都可以在controllers.js中找到
$stateProvider
//设置tabs指令的抽象状态
.state('tab'{
url:“/tab”,
摘要:没错,
templateUrl:'templates/tabs.html'
})
//每个选项卡都有自己的导航历史堆栈:
.state('tab.dash'{
url:“/dash”,
观点:{
“制表符”{
templateUrl:'templates/tab dash.html',
控制器:“DashCtrl”
}
}
})
.state('tab.chats'{
url:“/chats”,
观点:{
“选项卡聊天”:{
templateUrl:'templates/tab chats.html',
控制器:“ChatsCtrl”
}
}
})
.state('tab.chat detail'{
url:“/chats/:chatId”,
观点:{
“选项卡聊天”:{
templateUrl:'templates/chat detail.html',
控制器:“ChatDetailCtrl”
}
}
})
.state('tab.account'{
url:“/account”,
观点:{
“选项卡帐户”:{
templateUrl:'templates/tab account.html',
控制器:“AccountCtrl”
}
}
});
//如果上述状态均不匹配,则将其用作回退
$urlRouterProvider。否则('/tab/dash');
});

到目前为止,我甚至还没有接触app.js,所以我不知道具体的错误来自哪里。最终,当Angular无法实例化模块时,会发生此错误。通常,当出现问题或(可能在本例中)缺少依赖项时,会发生这种情况

// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
看起来
starter
模块正在尝试注入
starter.controllers
starter.services
。但是,注释中引用的脚本不会出现在HTML文件中。因为它们似乎没有被使用,所以你可以考虑删除它们

angular.module('starter', ['ionic'])
它看起来也是您试图使用的,但是,它也没有链接到您的HTML中,所以您也需要添加它

<script src="js/angular-ui-router.min.js"></script>


我们可能需要查看您的
app.js
的内容,以便在其中进行编辑。正如我提到的,我甚至没有接触app.js文件,所以我不理解这个错误