question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wizard step lazy loading

See original GitHub issue

Hi, is there a way to lazy load components inside a wizard-step?

For example, I have 2 wizard-step each one with a custom component inside. The first time that the wizard shows in the screen, those 2 components call the ngOnInit() function. Instead I need the second component to initialize just when the user reaches the second step.

Meanwhile I’m hadling this by using a *ngIf in every component with an index that stores the current step, but I believe this is a feature that must come with the wizard itself, isn’t it?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:9
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Sameer235711commented, Jun 25, 2022

This approach worked well for me

  1. Used *ngIf on the content inside of each step instead of the step itself.
  2. Gave each step an ID and used it in the *ngIf statements

Example:

<aw-wizard #wizard>
    <aw-wizard-step stepId="<step-id-1>" stepTitle="<step-title-1>">
        <component-1 *ngIf="wizard.currentStep?.stepId === '<step-id-1>'">
        </component-1>
    </aw-wizard-step>

    <aw-wizard-step stepId="<step-id-2>" stepTitle="<step-title-2>">
        <component-2 *ngIf="wizard.currentStep?.stepId === '<step-id-2>'">
        </component-2>
    </aw-wizard-step>
</aw-wizard>
1reaction
leonardomaiercommented, Mar 18, 2021

Same problem here, it would be nice to have this feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a Lazy Loaded Wizard in Vue.js - DigitalOcean
Let's see how to create a wizard that lazy loads its parts in Vue.js. The Wizard Steps. Each step in a wizard is...
Read more >
Is Primefaces Wizard lazy loaded - Stack Overflow
No it is not lazy loaded, when do firebug primeface wizard showcase I can see second tab contents. You need to handle it...
Read more >
Releases - 0.9.0 - Clarity Design System
To notify us that you want a spinner to be displayed while lazy loading, ... Moving from a 0.8 wizard to a 0.9...
Read more >
Re: Lazy loading of Wizard's steps - The Mail Archive
Re: Lazy loading of Wizard's steps ... org.apache.wicket.extensions.wizard.next=hooray ... into your page's resource file (e.g. MyPage.properties).
Read more >
Wizard step only loads first of two page includes - Questions - Skuid ...
Two page includes on a wizard step. Both are set to lazy-load. Only the first one is loaded, no matter what order they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found