user2101411
user2101411

Reputation: 1202

angularjs form issues

I'm having issues with trying to get a form to work with angularjs. Here is the error

{"error": "Shell form does not validate{'html_initial_name': u'initial-js_lib', 'form': <mooshell.forms.ShellForm object at 0x9bd4f8c>, 'html_name': 'js_lib', 'html_initial_id': u'initial-id_js_lib', 'label': u'Js lib', 'field': <django.forms.models.ModelChoiceField object at 0x9dc06ec>, 'help_text': '', 'name': 'js_lib'}"}

In case this may help, this is the jsfiddle I am using:

http://jsfiddle.net/YYrZ3/

Thanks!

Upvotes: 1

Views: 305

Answers (1)

bmleite
bmleite

Reputation: 26880

There are some things wrong in your fiddle:

  1. You need to load AngularJS framework (change from "No-library" to "AngularJS 1.0.3")
  2. Set the load method to "no-wrap (head)"
  3. Define the app (<body ng-app="customerApp">) on the info panel
  4. Fix your func service (check the fiddle below). You're definning functions on the module and not on the service. Also check AngularJS service documentation.
  5. Remove the method="post" from your HTML

jsfiddle: http://jsfiddle.net/YYrZ3/1/

Upvotes: 2

Related Questions