我正在尝试将模块注入另一个模块的依赖项。这是我的代码 -
USER.JS -
'use strict'
var module = angular.module('startUp', ['ngMaterial', 'ngRoute', 'signUpModule']);
module.controller('myController', function($scope) {
});
module.config(['$mdThemingProvider','$routeProvider', function($mdThemingProvider, $routeProvider){
// Configure a dark theme with primary foreground yellow
$mdThemingProvider.theme('default')
.primaryPalette('teal')
.accentPalette('brown')
.dark();
$mdThemingProvider.setDefaultTheme('default');
}]);
SIGNUP.JS -
'use strict'
var signUpModule = angular.module('signUpModule', ['ngMaterial', 'ngMessages', 'ngRoute']);
signUpModule.controller('signUpController', function($scope) {
$scope.user = {
title: '',
email: '',
firstName: '',
lastName: '' ,
company: '' ,
address: '' ,
city: '' ,
state: '' ,
biography: '',
postalCode : ''
};
});
signUpModule.config( function($mdThemingProvider){
// Configure a dark theme with primary foreground yellow
$mdThemingProvider.theme('docs-dark', 'default')
.primaryPalette('pink')
.dark();
});
这是我的HTML -
<body ng-app="startUp">
<section ng-controller="myController">
<md-content>
<md-toolbar class="md-primary" layout-gt-sm="row" layout-sm="column">
<div class="md-toolbar-tools logo" flex="10">
</div>
<span flex-gt-lg="70" flex-gt-md="50" flex-gt-sm="30" hide-sm></span>
<div class="md-toolbar-tools" flex-gt-sm="20" flex-sm="10">
<md-button class="md-no-ink md-accent" ng-href="http://www.last.fm/api/auth/?api_key=32ec32811f5c4db3c68317004d8a7d32&cb=http://localhost:65194/LastFM/index.html"
target="_blank" flex>Log In</md-button>
<md-button class="md-no-ink md-accent" ng-href="signup" flex>Register</md-button>
</div>
</md-toolbar>
<!--<section class="content">
<h1 class="font">Connect to your LAST FM Profile!</h1>
<md-content ></md-content>
</section>-->
<div ng-view></div>
<section class="footer">
</section>
</md-content>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-resource.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.3/angular-material.min.js"></script>
<script src="user.js" type="text/javascript"></script>
<script src="signup.js" type="text/javascript"></script>
这是错误 -
`Error: [$injector:modulerr] http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=startUp&p1=%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Fmodulerr%3Fp0%3DsignUpModule%26p1%3D%255B%2524injector%253Amodulerr%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.3.15%252F%2524injector%252Fmodulerr%253Fp0%253DngMessages%2526p1%253D%25255B%252524injector%25253Anomod%25255D%252520
知道为什么没有注射吗?我的代码有问题吗?我在线查看了GITHUB上的一些示例项目,但没有发现任何差异。