3

I can't understand why this doesn't work. The error is

Error: Argument 'TodoCtrl' is not a function, got undefined

I guess the issue is simple, but I can't solve it. In general, I want to change the text periodically.

1 Answer 1

8

To get your fiddle working I changed the following:

  1. Changed onLoad to no wrap (body)
  2. Changed the framework to AngularJS 1.0.1

Here is a sample fiddle based on your original fiddle note the following changes based around bypassing jQuery for DOM/model updates:

  1. Angular's built in $timeout service is used instead of setInterval and clearInterval since modifying the model outside of AngularJS shouldn't be done if easily avoided. If you want to do so be sure and look at $apply.
  2. Whenever you update the model in JavaScript any bound UI elements will automatically be updated.
Sign up to request clarification or add additional context in comments.

2 Comments

Changing onLoad to nowrap in jsFiddle also helped me thanks! WHHYY is this necessary?
For more details see this post

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.