Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ng-model pointing to an expression containing square brackets fail if a middle value is undefined #8039

Closed
gustavohenke opened this issue Jul 1, 2014 · 3 comments

Comments

@gustavohenke
Copy link

If I have a ng-model pointing to an expression which contains square brackets, and a middle value is undefined, an error like the following will be thrown:

TypeError: Cannot set property 'foo' of undefined

Example code:

<input type="text" ng-model="foo.bar['baz']">
<input type="text" ng-model="foo['bar'].baz">

I have tested this in v1.2.16 and then in v1.2.19. Both have the same problem.
Reproducible plunk: http://plnkr.co/edit/NKgyYDkqjOugjbNjWnmA?p=preview

@rodyhaddad rodyhaddad self-assigned this Jul 1, 2014
@rodyhaddad rodyhaddad added this to the 1.3.0 milestone Jul 1, 2014
rodyhaddad added a commit to rodyhaddad/angular.js that referenced this issue Jul 8, 2014
rodyhaddad added a commit to rodyhaddad/angular.js that referenced this issue Jul 8, 2014
rodyhaddad added a commit to rodyhaddad/angular.js that referenced this issue Jul 9, 2014
rodyhaddad added a commit to rodyhaddad/angular.js that referenced this issue Jul 16, 2014
@mike-marcacci
Copy link

Hi there, just wondering if this could be bumped up from "inconvenience" severity. It's a total blocker for me on json-schema-form/angular-schema-form#43

rodyhaddad added a commit to rodyhaddad/angular.js that referenced this issue Jul 27, 2014
rodyhaddad added a commit that referenced this issue Jul 27, 2014
@rodyhaddad
Copy link
Contributor

@mike-marcacci We should have a new release next friday with the fix for this from #8113.

You can use the latest snapshot to run your tests until the next release happens :-)

@mike-marcacci
Copy link

You guys are awesome - definitely didn't expect a response until at least Monday. Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.