1

I've created a small calculator and now with help have got it working the way I want in Javascript. When I try and convert this AngularJS to coffeescript I get this error:

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

The code is actually working but the error is showing up in the java console, is there a way to fix this?

Here is my JSFiddle: http://jsfiddle.net/YUza7/13/

2
  • You can include your extra CSS and JS in the Manage Resources panel so you don't need your "ugly hack": jsfiddle.net/ambiguous/YUza7/12 Commented Oct 3, 2012 at 5:27
  • Thank you that is much cleaner Commented Oct 3, 2012 at 5:32

2 Answers 2

3

You must remove the ng-app attribute since you use the manual bootstrap:

http://jsfiddle.net/g/YUza7/18/

anyway, you must use manual bootstrap with coffeescript on JsFiddle (the automatic was throwing the error because the coffeescript is not yet executed at that point)

EDIT: fixed the html: http://jsfiddle.net/g/YUza7/19/

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

Comments

0

You can write:

TodoCtrl = ($scope) ->
    $scope.$watch 'one * two', (value) ->
        $scope.total = value

Unfortunately jsFiddle incorrect work with CoffeScript + AngularJS

Comments

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.