我想注入一个配置到我的角度应用程序。该应用程序还包含一个运行对象。配置角度注射器错误()
但是当我添加配置选项时,我得到一个$ injector:modulerr错误。我找不到错误。
var myApp = angular.module('myApp',[
'ngAnimate',
'ui.bootstrap',
'ui.router',
'angular.filter',
'angularUtils.directives.dirPagination',
'validation.match',
'ngSanitize',
'ngCookies',
'pascalprecht.translate',
'toggle-switch',
'angucomplete-alt',
'cgPrompt',
'dndLists',
'ngFileUpload',
'ui.router.breadcrumbs',
'angular-bind-html-compile',
'rzModule', // range slider (i.e. for price filter)
'ngFileSaver',
'angular-input-stars',
'textAngular',
'textAngular-uploadImage'
]);
myApp.config(function($provide) {
$provide.decorator('taOptions', function($delegate) {
$delegate.toolbar[1].push('uploadImage');
return $delegate;
});
});
myApp.run(['$rootScope', '$window', '$location', '$stateParams', '$api', '$translate', '$transitions', '$state',
function($rootScope, $window, $location, $stateParams, $api, $translate, $transitions, $state) {
//rootscope
}]);
这是关于textAngular-uploadImage模块(https://github.com/mrded/textAngular-uploadImage)。当我删除配置选项时,我的应用运行良好,但是当然,我无法使用该模块。
这是什么原因?我在html中包含了所需的文件,textAngular(https://github.com/textAngular/textAngular)工作正常。
我该如何解决这个问题?或者在textAngular中有没有其他正常上传功能的选项?我也试过这个解决方案(https://github.com/textAngular/textAngular/issues/139#issuecomment-111205679),但我得到了同样的错误。
你尝试myApp.config([ '$提供',函数( $ provide){// code here}]) – Nikita
您尚未提供完整的错误讯息。它包含解决它的所有必要信息(它实际上是一个导致页面显示为可读形式的URL)。 – estus