0

I am trying to name an angular controller dynamically, like so:

app.controller(dynamic_name_constructed_here, ...);

Right now, when I run my program, I get an error:

Error: [ng:areq] Argument dynamic_name_constructed_here is not a function, got undefined

Is constructing the name the way I am constructing it allowed? If not, an explanation as to why this doesn't work would be awesome! If so, how can I eliminate this error?

Thanks in advance!

jeg
  • 51
  • 6
  • possible duplicate of [AngularJS Dynamic loading a controller](http://stackoverflow.com/questions/17674945/angularjs-dynamic-loading-a-controller) – ooozguuur Jul 23 '15 at 23:20
  • I think you provided `dynamic_name_constructed_here` as string instead of variable name.. That is what the error message says – PSL Jul 24 '15 at 00:15

0 Answers0