0

I am creating an Angular app and following the same architecture defined in http://yeoman.io/ for angular.

These are the attached snapshots of the project architecture and the controller file for which I am getting an error.

Error description:

Error: ng:areq
Bad Argument
Argument 'ApplicationController' is not a function, got undefined

enter image description here

enter image description here

enter image description here

PLease help!

Thanks in advance

Rahul lamba
  • 131
  • 7

3 Answers3

0

Please change angular.module("core").controller("ApplicationController",.....) to angular.module("core",[]).controller("ApplicationController",.....)

Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234
0

Change var applicationModuleName = 'calculateEngineApp'; to

var applicationModuleName = 'core';

Without seeing your html, I don't know what you are actually loading, but make sure your ng-app attribute points to 'core' and your ng-controller attribute points to 'ApplicationController'.

It appears that you are trying to load an application module by the name of 'calculateEngineApp' in your config, but then in your controllers you are saying the controllers are part of the 'core' module. I don't see 'core' being injected into the dependencies in your config.

tpie
  • 6,021
  • 3
  • 22
  • 41
0

Here is the solution

This is from the docs:

Beware that using angular.module('myModule', []) will create the module myModule and overwrite any existing module named myModule. Use angular.module('myModule') to retrieve an existing module.

Source: angularjs defining services for the same module in different files

Community
  • 1
  • 1
Rahul lamba
  • 131
  • 7