From 0fcd1e3b1fa6244d02f08631d9ef81bf79996fab Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Thu, 18 Jul 2013 20:44:27 +0200 Subject: fix(form): pick the right attribute name for ngForm Closes #2997 --- src/ng/directive/form.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ng/directive/form.js') diff --git a/src/ng/directive/form.js b/src/ng/directive/form.js index 5eec23f1..a348babf 100644 --- a/src/ng/directive/form.js +++ b/src/ng/directive/form.js @@ -23,7 +23,7 @@ var nullFormCtrl = { * * - keys are validation tokens (error names) — such as `required`, `url` or `email`), * - values are arrays of controls or forms that are invalid with given error. - * + * * @description * `FormController` keeps track of all its controls and nested forms as well as state of them, * such as being valid/invalid or dirty/pristine. @@ -42,7 +42,7 @@ function FormController(element, attrs) { controls = []; // init state - form.$name = attrs.name; + form.$name = attrs.name || attrs.ngForm; form.$dirty = false; form.$pristine = true; form.$valid = true; @@ -108,7 +108,7 @@ function FormController(element, attrs) { * * @description * Sets the validity of a form control. - * + * * This method will also propagate to parent forms. */ form.$setValidity = function(validationToken, isValid, control) { -- cgit v1.2.3