angular-shepherd
angular-shepherd copied to clipboard
Question: remove steps?
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();
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.
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.
@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.
I reproduced here:
https://stackblitz.com/edit/angular-tmx2ax?file=src/app/base/base.component.ts
I think I messed something up
@hebertlima I don't see anything running there.