diff --git a/src/ng/directive/form.js b/src/ng/directive/form.js index 6f1f587e1d19..d42bd26d14ab 100644 --- a/src/ng/directive/form.js +++ b/src/ng/directive/form.js @@ -41,6 +41,11 @@ function FormController(element, attrs) { errors = form.$error = {}, controls = []; + // do not link to parent form if not-required attr is defined + if (attrs.notRequired) { + parentForm = nullFormCtrl; + } + // init state form.$name = attrs.name || attrs.ngForm; form.$dirty = false;