aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ng/directive/form.js1
-rw-r--r--test/ng/directive/formSpec.js3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/ng/directive/form.js b/src/ng/directive/form.js
index 6b876e01..4f06f093 100644
--- a/src/ng/directive/form.js
+++ b/src/ng/directive/form.js
@@ -117,6 +117,7 @@ function FormController(element, attrs) {
element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS);
form.$dirty = true;
form.$pristine = false;
+ parentForm.$setDirty();
};
}
diff --git a/test/ng/directive/formSpec.js b/test/ng/directive/formSpec.js
index 51c6929f..2fd55f60 100644
--- a/test/ng/directive/formSpec.js
+++ b/test/ng/directive/formSpec.js
@@ -284,6 +284,9 @@ describe('form', function() {
inputB.$setValidity('MyError', true);
expect(parent.$error.MyError).toBe(false);
expect(child.$error.MyError).toBe(false);
+
+ child.$setDirty();
+ expect(parent.$dirty).toBeTruthy();
});