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!

2
  • possible duplicate of AngularJS Dynamic loading a controller Commented Jul 23, 2015 at 23:20
  • I think you provided dynamic_name_constructed_here as string instead of variable name.. That is what the error message says Commented Jul 24, 2015 at 0:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.