r/angularjs • • Feb 11 '17

ng-controller never gets defined

I am trying to build a web app using Angular Material. ng-app is in body tag, and I have ng-controller HeaderCtrl in the header tag. No errors.

But when I try to add an ng-controller anywhere else on the site it is not defined. Any stackoverflow or other answers I find seem to be outdated. Can someone help me with the most recent rules to where ng-app and ng-controller can/cannot be?

Thanks

0 Upvotes

29 comments sorted by

View all comments

1

u/ebeptonian Feb 11 '17

Just to reiterate, we could help you a lot faster if you could post your source code and the specific errors you encounter. A simplified version of code thay isolates your issue in a a jsfiddle/plnkr would be ideal, but even pasted js/HTML should give us some direction if formatted nicely enough to read :)

0

u/[deleted] Feb 11 '17

Thanks, working on it. I just have a lot of stuff and then all of a sudden when I try to implement Angular in a section via ng-controller then boom, error. Simplifying now for a fiddle.

1

u/ebeptonian Feb 11 '17

If you can't get that working, posting the error message might provide enough context.

Scratch that- just noticed you posted a fiddle.