{% extends "model-scope.html" %} {% load tutorial_tags %} {% block form_title %}Angular-Messages Demo{% endblock %} {% block form_header %}Adds support for form field error lists to be rendered to use the ngMessages directive.
Requires AngularJS 1.3+.{% endblock %} {% block form_tag %}name="{{ form.form_name }}" method="post" action="." novalidate ng-controller="MyFormCtrl"{% endblock %} {% block form_submission %}

 

Test submission of invalid Form data:
 

{% endblock %} {% block tutorial_intro %}

In this example, Form field error display and management is handled by the ngMessages directive.

If a Form inherits from NgMessagesMixin then each field error list is rendered in the correct format for the ng-messages module directive.

{% endblock tutorial_intro %} {% block tutorial_code %} {% autoescape off %}
{% pygments "forms/ng_messages.py" %}
{% pygments "views/ng_messages.py" %}
{% pygments "tutorial/ng-messages.html" %}
{% pygments "static/js/ng-messages.js" %}
{% endautoescape %}

Use this mixin if you want your field error lists to be managed by the ng-messages directive.
Note: An advantage over the standard field error list handling/display, is up to a 30% reduction in watchers.

{% endblock tutorial_code %} {% block angular_version %}1.3.20{% endblock %} {% block scripts %} {{ block.super }} {% endblock scripts %} {% block ng_module_dependencies %}['ng.django.forms', 'ng.django.angular.messages', 'ngMessages']{% endblock %} {% block demo_scripts %} {{ block.super }} {% endblock %}