我在angularJS应用程序中有这个配置
(function() {
'use strict';
angular
.module('myAppl.dashboard')
.config(configure);
configure.$inject = ['$stateProvider'];
function configure($stateProvider) {
$stateProvider
.state(getDashboardState());
////////////
function getDashboardState() {
var state = {
...
现在我将使用此配置的ngToast:
angular
.module('myModule')
.config(['ngToastProvider', function(ngToast) {
ngToast.configure({
verticalPosition: 'bottom',
horizontalPosition: 'center',
maxNumber: 3
});
}]);
我以为我可以像这样注入ngToast:
configure.$inject = ['$stateProvider', 'ngToast'];
function configure($stateProvider, ngToast) {
ngToast.configure({
verticalPosition: 'bottom',
horizontalPosition: 'center',
maxNumber: 3
});
但这导致未捕获错误:[$ injector:modulerr] 错误