Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was 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

Description

@gustavohenke

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions