未捕获错误: [$injector:模块rr] 由于以下原因无法实例化模块启动器:错误: [$injector:模块rr
Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to: Error: [$injector:modulerr]
我知道这很简单,但我已经尝试了几个小时,看不到它是什么。这是我的进口: '
<!-- 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');
});
我什至还没有碰过该应用程序.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'])
看起来您正在尝试使用UI Router,但它也没有在您的HTML中链接 - 因此您还需要添加它
<script src="js/angular-ui-router.min.js"></script>
相关文章:
- Javascript,访问一个主要对象模块模式中的每个对象
- 节点Js:How to catch a“;没有这样的文件或目录“;读取线模块出错
- 如何从模块链中调用函数.导出到节点中
- 尽管链接成功并已成功下载,但未找到NPM模块
- 角度.js:38未捕获错误:[$injector:模块rr]
- 角度错误: [$injector:模块rr] 由于以下原因无法实例化模块角度图表: 错误: [$injector:nom
- 错误:[$injector:模块rr] 与角度 JS [GULP CONTEXT]
- 角度$injector:模块rr模块错误
- 问题 - AngularJS 未捕获错误: [$injector:模块rr]
- AngularJS:骨架应用程序上的注入器模块rr错误
- 未捕获的错误:[$injector:模块rr] 加载角度.js需要
- 未捕获的错误: [$injector:模块rr]
- 角度误差:未捕获错误:[$injector:模块rr]
- 角度错误:$injector:模块rr模块错误
- 未捕获错误: [$injector:模块rr] 由于以下原因无法实例化模块启动器:错误: [$injector:模块rr
- 未捕获的错误:[$injector:nomod] 和未捕获的错误:[$injector:模块rr]
- [$injector:模块rr] 错误
- "$注入器:模块rr”:模块名称的抛出错误不可用,但实际上它是可用的
- 我一直收到错误:$injector:模块rr模块错误与AngularJS
- 角度错误:未捕获错误:[$injector:模块rr] 无法实例化模块