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

ngModelWatch breaks if $modelValue is object #6648

Closed
serzh opened this issue Mar 11, 2014 · 1 comment
Closed

ngModelWatch breaks if $modelValue is object #6648

serzh opened this issue Mar 11, 2014 · 1 comment

Comments

@serzh
Copy link

serzh commented Mar 11, 2014

When using ngModel inside custom directive there is a chance to break ngModelWatch fn. On the first run ngModelWatch will set $modelValue to ngModelGet($scope). Then, if you change property of that scope var (ngModelGet($scope)) it will change the properties on the $modelValue, because it is the same object! So if you have some $formatters they won't be called at all.

Here is plnkr for demonstration.

@lefos987 lefos987 self-assigned this Mar 12, 2014
@lefos987 lefos987 removed their assignment Mar 12, 2014
@btford btford added this to the Backlog milestone Mar 17, 2014
@btford btford removed the gh: issue label Aug 20, 2014
@Narretz
Copy link
Contributor

Narretz commented Sep 11, 2015

Duplicate of #5449

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

No branches or pull requests

4 participants