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

Question: remove steps? #789

Open
hebertlima opened this issue Sep 23, 2021 · 5 comments
Open

Question: remove steps? #789

hebertlima opened this issue Sep 23, 2021 · 5 comments
Labels
question Further information is requested

Comments

@hebertlima
Copy link

hebertlima commented Sep 23, 2021

Hi there!

is there any way to remove all steps?

in the official documentation there is a destroy() method but it didn't work:

something like:

this.onboarding.addSteps([]); // exists
this.onboarding.removeStep(name);
this.onboarding.remove();
this.onboarding.destroy(); 
@RobbieTheWagner
Copy link
Member

destroy is for steps, not for the tour itself. There is not a way to destroy all the steps. However, if you are using this angular wrapper, each time you call addSteps it creates a new tour, so that should be doing what you want.

@hebertlima
Copy link
Author

Thanks for the quick response!
I'm using a components extends architecture, so every time a component is loaded, all the data is persisted and this causes an overload of steps (each component have diferents steps and all push into this.onboarding.addSteps([]);), my intention would be to destroy or reset the steps within the ngOnDestroy() from each component.

@RobbieTheWagner
Copy link
Member

@hebertlima I don't understand. addSteps in this package will make a new tour every time, so you just need to pass it whatever steps you want to display.

@hebertlima
Copy link
Author

hebertlima commented Sep 24, 2021

I reproduced here:

https://stackblitz.com/edit/angular-tmx2ax?file=src/app/base/base.component.ts

I think I messed something up

@RobbieTheWagner
Copy link
Member

@hebertlima I don't see anything running there.

@RobbieTheWagner RobbieTheWagner added the question Further information is requested label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants