-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Hide/show an optional step #75
Comments
What do you mean by "hide/show"? |
@madoar I hope my explanation was clear this time |
@asalhani Simply put *ngIf on the you want to show/hide based on some user input from step 1. |
It should work exactly like @furqanaziz wrote. |
Hi there ! First thanks for this nice component. I'm trying to implement the same behaviour with steps hidden when not applicable (depending on a REST api call), so I implemented a similar solution using a kind of:
This is working great, except in logs angular is complaining about it:
I'm not sure where it comes from step1Available is only assigned in a Subscribe() of an observable and not binded to children components. Any idea ? Edit: it might be related to this angular/angular#15634 |
@patriceo Please try putting
|
Hi @furqanaziz I managed to fixed it, but my fix is not that simple. I injected the ChangeDetectorRef in my component constructor and I called detach() before manipulating my variables then reattach() / detectChanges() right after. However I will try your proposal ! |
I am having an issue where using *ngIf causes the steps to no longer function and transition between each properly. The second step ends up getting stuck if I hide the first step based off a variable. I noticed in the latest that there is no way to reset or rebuild the wizard programmatically either. |
@myspivey do you mind sharing plunker or your code a bit, I thin there might be complex |
Sadly I can not but will try to get something together. Having said that, I do not have any canExit or Enter setup, it is using navigationMode="free" and that is all. It strikes me the issue is that if I hide the step after creation, instead of moving to the next step the component is staying on that first step even though it is no longer technically part of the process. |
Sorry for late follow up. I tried to apply the solution proposed earlier by @furqanaziz and @madoar, however it didn't worked. So what I did is I set the step to be optional then I rendered it inside Although this is worked for me, I highly encourage @madoar to consider making this as configuration on the step to make our life (dev :) easier. |
Ok, it's possible that I now know where the error is located. To solve the problem once and for all, it should suffice to add a listener to the |
@candorthor your question here is a duplicate of #201, right? |
@madoar
I need your kind support to show me how I can hide/show an optional step using typescript.
I went through your code, I discovered that there is a [hidden()] function in wizard-step.interface.ts
()
However, it only allow get, therefore, I can't set the step hidden proparty.
thank you
The text was updated successfully, but these errors were encountered: