<mat-card class="CBAform">
<mat-card-content>
<mat-horizontal-stepper [linear]=true #stepper (selectionChange)="changeRoute($event)">
- <a *ngFor="let routeLink of routeLinks; let i = index;">
- <mat-step>
+ <a *ngFor="let routeLink of stepsRequired; let i = index;">
+ <mat-step style="display: none;">
<ng-template matStepLabel>{{routeLink.label}}
</ng-template>
</mat-step>
styleUrls: ['./cbawizard.component.scss']
})
export class CBAWizardComponent implements OnInit {
- @Input() stepsRequired: any;
+ @Input() stepsRequired: any[];
@ViewChild('stepper') stepper: MatStepper;
@Output() stepChanged = new EventEmitter();
public stepDetails = GlobalContants.cbawizard.stepsRequired.steps;
activeLinkIndex = -1;
- constructor(private router: Router) {
+ constructor(private router: Router) {
this.routeLinks = [
{
label: 'CBA Metadata',
// this.activeLinkIndex = this.routeLinks.indexOf(this.routeLinks.find(tab => tab.link === this.router.url));
// this.stepper.selectedIndex = this.activeLinkIndex;
// });
- this.routeLinks.forEach((step, index)=>{
+ this.stepsRequired.forEach((step, index)=>{
if(step.link == this.router.url) {
this.stepper.selectedIndex = step.index
}
}
changeRoute(event){
- this.routeLinks.forEach((step, index)=>{
+ this.stepsRequired.forEach((step, index)=>{
if(index == event.selectedIndex) {
this.router.navigate([step.link]);
}