0

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 ?

http://jsfiddle.net/up8pv/3/

1 Answer 1

1

My actions:

  1. added name for the module and initialized it explicitly via angular.module()
  2. made sure that RaffleCtrl is proper function
  3. 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 :)

http://jsfiddle.net/up8pv/5/

Sign up to request clarification or add additional context in comments.

3 Comments

actually, I noticed that you had changed coffeescript to javascript. When I changed back to coffeescript, the problem re-appeared. Could it be that?
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!
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.

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.