I have the following app.js and its unable to invoke the app with modules. attached screenshot of folder structure and code:
core.module.js:
(function() {
'use strict';
angular
.module('app.core');
})();
(function () {
'use strict';
angular
.module('app', [
'ngRoute',
'ngCookies',
'ngAnimate',
'ngResource',
'ngCookies',
'ngTouch',
'app.core',
'app.events'
])
.config(config);
config.$inject = ['$routeProvider', '$locationProvider', '$httpProvider'];
function config($routeProvider, $locationProvider, $httpProvider) {
$routeProvider
.when('/', {..}..
Uncaught Error: [$injector:nomod] Module 'app.core' 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.
You need the second param on angular.module();
See Document
// Create a new module
var myModule = angular.module('myModule', []);
angular
.module('app.core',[]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With