-
Notifications
You must be signed in to change notification settings - Fork 310
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
nested rv-if binders mess #512
Comments
Hi, Here is a fiddle representing the minimal number of changes necessary to get this working for you. The important point is that I am passing an object to the rivets bind, that properties are access from. instead of rivets.bind(element, scope); It became rivets.bind(element, { scope : scope }); This ensures that when in the html, you can do: <div rv-if='scope.main'>
<div rv-id='scope.nested'>
</div>
</div> This issue is related to : #486 I do not fully understand why this is an issue yet. But I have seen a few people run into it so I will put some effort into it soon. But basically, you should access properties on your scope, THROUGH, your scope. This way everything can stay in sync. Please let me know if this helps you. If it does, please close the issue. I do not believe it is a bug in rivets, but a misunderstanding on how it observes properties. We have seen a few people bring this up, so I will put it in my list of things to include in the documentation. |
Yes, including this in the docs would be great, because the observing mechanics is quite unclear and I don't have time to dive deeper in rivets's code. However, if the issue is already openned elsewhere, I'll close this one. Thanks for the help. |
I have a problem with nested
rv-if
binders, it works only if you set thenested
value totrue
first and then update themain
one, see the code (Fiddle here):HTML
JS
The text was updated successfully, but these errors were encountered: