AngularJS Module 'app.module' is not available -


i'm using frontapp loads dependancies , i'm stuck error :

 uncaught error: [$injector:modulerr] failed instantiate module moduleapp due to:  error: [$injector:modulerr] failed instantiate module app.module due to:  error: [$injector:nomod] module 'app.module' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument. 

i miss on syntax call can't figure out :/

index.html

<!doctype html> <html ng-app="moduleapp"> .....  <script src="app/app.module.js"></script> <script src="app/module/module.route.js"></script> <script src="app/module/module.controller.js"></script> 

app/app.module.js

(function (angular) { 'use strict';  var moduleapp = angular.module('moduleapp', [     'app.module' ]);   })(angular); 

app/module/module.route.js

(function () { 'use strict';  angular     .module('app.module')     .run(apprun);     ..... 

app/module/module.controller.js

(function (angular) { 'use strict';  angular      .module('app.module')      .controller('modulecontroller', modulecontroller);  modulecontroller.$inject = [...]; 

you never create app.module module. on app/module/module.route.js

(function () { 'use strict';  angular     .module('app.module', [])     .run(apprun);     ..... 

and file should loaded before file contains:

(function (angular) { 'use strict';      var moduleapp = angular.module('moduleapp', [         'app.module'     ]);  })(angular); 

or add on app/app.module.js file:

(function (angular) { 'use strict';     angular.module('app.module', []);      var moduleapp = angular.module('moduleapp', [         'app.module'     ]);       })(angular); 

i recommend choose meaningful names modules, i9t strange have app.module , appmodule modules.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -