diff options
| author | Pawel Kozlowski | 2013-07-18 20:44:27 +0200 | 
|---|---|---|
| committer | Igor Minar | 2013-07-24 14:41:54 -0700 | 
| commit | dc1e55ce1a314b6c1ad4b9d5b4a31226e1fa1e18 (patch) | |
| tree | 44795a8f90ab110067d149b107c94cc105da16b2 /test/ng | |
| parent | 408e868237d80f9332f2c540f91b2809d9938fbc (diff) | |
| download | angular.js-dc1e55ce1a314b6c1ad4b9d5b4a31226e1fa1e18.tar.bz2 | |
fix(form): pick the right attribute name for ngForm
Closes #2997
Diffstat (limited to 'test/ng')
| -rw-r--r-- | test/ng/directive/formSpec.js | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ng/directive/formSpec.js b/test/ng/directive/formSpec.js index 347d4476..f8e4cf63 100644 --- a/test/ng/directive/formSpec.js +++ b/test/ng/directive/formSpec.js @@ -63,6 +63,17 @@ describe('form', function() {      expect(scope.myForm.alias).toBeDefined();    }); +  it('should use ngForm value as form name when nested inside form', function () { +    doc = $compile( +      '<form name="myForm">' + +        '<div ng-form="nestedForm"><input type="text" name="alias" ng-model="value"/></div>' + +      '</form>')(scope); + +    expect(scope.myForm).toBeDefined(); +    expect(scope.myForm.nestedForm).toBeDefined(); +    expect(scope.myForm.nestedForm.alias).toBeDefined(); +  }); +    it('should publish form to scope when name attr is defined', function() {      doc = $compile('<form name="myForm"></form>')(scope);  | 
