我正在使用Ng2-archwizard,我想要的是使用component.ts进行下一步,我的意思是使用javascript函数:
<wizard>
<wizard-step stepTitle="Title of step 1">
Content of Step 1
<button type="button" nextStep>Next Step</button>
<button type="button" goToStep="2">Go directly to third Step</button>
</wizard-step>
<wizard-step stepTitle="Title of step 2" optionalStep>
Content of Step 2
<button type="button" previousStep>Go to previous step</button>
<button type="button" nextStep>Go to next step</button>
</wizard-step>
<wizard-step stepTitle="Title of step 3">
Content of Step 3
<button type="button" previousStep>Previous Step</button>
<button type="button" (click)="finishFunction()">Finish</button>
>/wizard-step>
最佳答案
在您的组件中尝试:
// At the top of my component class that implements the <wizard>
@ViewChild(WizardComponent)
public wizard: WizardComponent;
// then later, this works great
this.wizard.model.navigationMode.goToStep(1)