1

I work with the latest version of Wizard for Angular 2 and I had a question: How do I change the label of the Next and Back buttons. And also if it is possible, in the input, when clicking on enter, to advance the step. It would be great to have your help.

Thanks a lot.

The link for the component is: https://www.npmjs.com/package/angular2-wizard

  • So you're asking for 2 things: 1) Change the text of the navigation buttons. 2) Navigate forward on Enter keypress. Is this correct? – Keenan Diggs Jan 04 '19 at 21:21

1 Answers1

0

For the button text, unfortunately it looks like the developer of this libary hard-coded it. So this is unsupported by the Wizard component's API: https://github.com/maiyaporn/angular2-wizard/blob/master/src/wizard.component.ts#L19

I don't know what input you're referencing, but if you want to capture an Enter keypress, you can follow a strategy similar to: Angular 2 HostListener keypress detect escape key?

Or, if you're input is part of an html form, an Enter keypress from a form field should automatically submit the form. You could hook into the submit event and perhaps call the public next() method on the Wizard: https://github.com/maiyaporn/angular2-wizard/blob/master/src/wizard.component.ts#L92

You can read the source (it's pretty small) on the github page to get more ideas/reevaluate your use case.

Keenan Diggs
  • 2,287
  • 16
  • 17