Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bo-value does not work with ng-model #76

Open
dbkingsb opened this issue Apr 16, 2014 · 4 comments
Open

bo-value does not work with ng-model #76

dbkingsb opened this issue Apr 16, 2014 · 4 comments
Labels

Comments

@dbkingsb
Copy link

In this fiddle, change the ng-value to bo-value, and you'll see the demo fail.
http://jsfiddle.net/NHVBW/

I can get the intended outcome (a "unwatched" value) by removing the watcher from ng-value's source, so it seems like bo-value should be able to accomplish the same thing.

I haven't spent the time to figure out how ng-model works, but my guess is that this is a order-of-events issue between ng-model and bo-value; when I inspect the rendered HTML, bo-value successfully added the 'value' attribute.

@Pasvaz
Copy link
Owner

Pasvaz commented Apr 18, 2014

I tried the demo, bo-value actually set the value of the input as expected, if you inspect the DOM you can see the $index value inside the input. Apparently the problem is that ng-model ignore it. It may be a problem with priority but it's just a guess, I need to investigate more and fix it, at the moment I'll label this issue as bug.

@Pasvaz Pasvaz added the bug label Apr 18, 2014
@mikestopcontinues
Copy link

It seems like attrs.$observe is missing link between bo-value and ng-model. At any rate, this commit fixes it, and should fix other issues that might come up.

@Pasvaz
Copy link
Owner

Pasvaz commented Apr 24, 2014

@mikestopcontinues it sounds good, did you test attrs.$set enough to consider it stable?

@mikestopcontinues
Copy link

I put it into use at work this morning, where we use bindonce for almost everything. It's stable.

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

No branches or pull requests

3 participants