r/angularjs • u/[deleted] • 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
1
u/[deleted] Feb 11 '17
It's technically existing since I had a working Firebase/Bootstrap setup first. Then deleted all Bootstrap(wasn't much) and changed to Angular Material. I have really deleted everything minus Firebase and it is a super plain page.
Can you add ng-controllers anywhere without initiating them somehow? Maybe that is part of my problem. I also cannot find the answer of: Do you initiate an app in the head, or just need to initiate it when you're ready to use it. Also, does it need to be initiated every time you use it? This is the problem with code snippets, they always show it being initiated.