Closed avalanche1 closed 8 years ago
Maybe that's the same issue as https://github.com/ManuelDeLeon/viewmodel/issues/220
If you have a condition block, the VM inside (or Blaze instance) is not created unless after the condition is true. You could check if that VM exists first, before trying to do anything.
I think they mean the event handler isn't there when the condition is true. I'll try one more thing and if that doesn't work I'll say F! It and revert all these changes and be incompatible with Astronomy and tap i18n. On Apr 1, 2016 7:50 AM, "Dave Lee" notifications@github.com wrote:
If you have a condition block, the VM inside (or Blaze instance) is not created unless after the condition is true. You could check if that VM exists first, before trying to do anything.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/ManuelDeLeon/viewmodel/issues/222#issuecomment-204403242
@ManuelDeLeon , I have a weakly related question (not issue), sounds like the opposite. e.g. I have a template with a form. The form contains repeating subforms. Say Driver1, Driver2, etc. When uses want to input Driver2, I turn on a condition, and Driver2 renders. When user try 'Remove' Driver2, I'd like reset Driver2 form and hide it. Hiding is fine. Problem is the subform elements are all components (controls) with parameters passing in data. Calling reset() will lost the data passed in and fall back to default props in the raw components. That renders the form useless. Of course I could manually 'reset' the fields in the components. I'm wondering what's the best approach to achieve this in VM. Is there a way to re-Render a component with the initial parameters ? Thanks.
Maybe vm should rebind itself after a flush?...
Yes, for my use case, that would be very useful if the component (control) could be rebined after reset()
On Fri, Apr 1, 2016 at 10:28 PM, Artem Saffron notifications@github.com wrote:
Maybe vm should rebind itself after flush?...
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ManuelDeLeon/viewmodel/issues/222#issuecomment-204416985
Reopen if it doesn't work in v4.0.11
@daveeel I think I follow but make a simple repro and open an issue.
Funciona como un reloj :+1:
But where are all the b-id
attributes? :eyes:
I got rid of them as part of the rage I got into because of these series of issues essentially triggered by how other packages destroy and recreate elements, and then mess up onViewReady.
I got rid of them as part of the rage Hehe!
But tap:i18n
remains compatible? I was planning on using it when I go global (whoa!)
It does work with tap:i18n and all its shenanigans...
Yeah, I feel you. We all go through ordeals caused by others sometimes...
If I have a dom element with a vm binding enclosed in {{if currentUser}} condition, elements get unbinded whenever user is logged-in or out. Check here If you press login or logout the div with text disappears whereas it should change. I didn't test it with other
if
conditions but I think it's a generic problem.