Ability to wrap <wizard-step> in own component
See original GitHub issueFound your library, which seems to be the only one to support Angular 4, so props to you for this awesome thing! I started implementing some wizard steps and wanted to extract the wizard-steps in their own components. However when I did this, the controls didn’t show up in the wizard.
Libraries used:
- @angular/*: ^4.2.3
- typescript: 2.4.0
- ng2-archwizard= ^1.6.0
Consider this example:
<wizard navBarLocation="top" class="width-80">
<app-wizard-details></app-wizard-details>
/* more steps here */
<wizard-completion-step title="Conclusion" navigationSymbol="3">
</wizard-completion-step>
</wizard>
/* app-wizard-details */
<wizard-step title="First step" navigationSymbol="1">
<form [formGroup]="detailsForm" >
<md-input-container>
<input mdInput formControlName="name" type="text">
</md-input-container>
<md-input-container>
<input mdInput formControlName="offerNumber" type="text">
</md-input-container>
</form>
<button md-raised-button (finalize)="storeDetails()" nextStep>Next</button>
</wizard-step>
What works is the following, but then I cannot make use of your triggers like canExit
and stepEnter
, since the callbacks might be defined in the child components, not in the root component:
<wizard-step title="First step" navigationSymbol="1">
<app-wizard-details></app-wizard-details> /* has the <form> tag as root element now */
</wizard-step>
I’d love to see the support of wrapped wizard-steps implemented. That way, you’d be able to build complex wizards without having everything in one single file.
Oh, and: Sorry for not providing a Plunker, for some reason it won’t load your library from unpkg (guess due to proxy issues)
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (10 by maintainers)
Top GitHub Comments
Yes, such an input would be possible. I’m just not sure yet, if I want to add this as a normal
@Input
or as an directive.I think I’ve found a way to do this. As far as I’ve discovered we’ll need both https://angular.io/api/core/InjectionToken and https://github.com/angular/angular/issues/12758 for this. I’ll take a more detailed look at this later next week.