progress-stepper/src/progress-stepper.service.ts
ProgressStepperService allows to control ProgressStepper programmatically. It provides logic to navigate between steps, get ProgressStepper's current state and can be used to access its steps.
In your app, provide a service instance for each ProgressStepper instance.
Example :@Component({
selector: 'app-my-component',
providers: [{ provide: ProgressStepperService, useClass: ProgressStepperService }],
})To control ProgressStepper, consume the service in your app.
Example :private service: ProgressStepperService = inject(ProgressStepperService);
console.log(`Currently selected step is at index ${this.service.selectedIndex()}.`);import { ProgressStepperService } from '@talenra/components/progress-stepper';See ProgressStepperBodyComponent
Properties |
|
Methods |
| Public canSkipTo | ||||||
canSkipTo(index: number)
|
||||||
|
Check whether we can proceed to a given step index. Returns
Parameters :
Returns :
boolean
|
| Public getStepAt | ||||||
getStepAt(index: number)
|
||||||
|
Retruns the step at the given index or null. Example :
Parameters :
Returns :
ProgressStepComponent | null
|
| Public next |
next()
|
|
Switch to the next step if available. Returns the index of the selected step after navigation. Example :
Returns :
number
|
| Public previous |
previous()
|
|
Switch to the previous step if available. Returns the index of the selected step after navigation. Example :
Returns :
number
|
| Public skipTo | ||||||
skipTo(index: number)
|
||||||
|
Skip to the step at the given index. Returns the index of the selected step after navigation. Example :
Parameters :
Returns :
number
|