I have created a basic angular app on jsfiddle. However, whenever I add a ng-controller, my code breaks. Any idea what it could be ?
1 Answer
My actions:
- added name for the module and initialized it explicitly via
angular.module() - made sure that
RaffleCtrlis proper function - changed jsFiddle type to be
No wrap - in <body>
This has proven to fix the issue. I suggest you to investigate each one of this three hints to know for sure what the root of the evil was :)
3 Comments
Karan
actually, I noticed that you had changed coffeescript to javascript. When I changed back to coffeescript, the problem re-appeared. Could it be that?
Karan
looks like it might have been all three, if I turn off one of the three options, it doesnt work! I'll investigate and let you know!
ŁukaszBachman
Great that you have made some progress. Sorry, I'm not an expert on
coffescript, don't know if it can be a factor. One thing for sure - controller needs to be a function, not a {} like object.