我对棱角JS接收错误有问题。
jquery.js:7993 Uncaught Error: [$injector:modulerr] Failed to instantiate module application due to:
Error: [$injector:nomod] Module 'application' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.我的控制器是controller.js,如下
angular.module('application') .controller( 'controller', [ '$scope', 'service', '$uibModal', '$uibModalStack','$rootScope', function($scope, service, $uibModal, $uibModalStack,$rootScope) {}]);我的服务是service.js,如下所示
angular.module('application').service('service',
[ '$resource', function($resource) {
var requstService = $resource('test', {}, {
});
return requstService;
} ]);当我加载视图页面时,它运行得很完美,但是当我再次单击站点链接时,它就显示在上面的error.Please帮助中。
发布于 2017-02-01 07:51:19
你的控制器应该是,
angular.module('siteApplication',[]) .controller( 'siteController', [ '$scope', 'siteService', '$uibModal', '$uibModalStack','$rootScope', function($scope, siteService, $uibModal, $uibModalStack,$rootScope) {发布于 2017-02-01 07:55:12
在控制器中使用[]创建这样的模块。
angular.module('moduleName', [])并在html页面中使用这个,比如ng-app="moduleName"。
并添加与$uibModal相关的依赖关系js文件。
发布于 2017-02-01 08:18:50
您的模块缺少[],您的控制器应该如下所示:
angular.module('siteApplication',[])另外,你不是故意粘贴控制器的结束部分,即} ]);吗?
https://stackoverflow.com/questions/41974447
复制相似问题