I am creating custom stepper using CDKStepper in angular 7,
I am using
<cdk-step>
<ng-template cdkStepLabel>Fill out your name 1</ng-template>
<p>This is any content of "Step 1"</p>
</cdk-step>
and in stepper template - for navigation, I am using
<ul class="nav nav-pills wizard-navigation-ul">
<li class="step" *ngFor="let step of steps; let i = index;" [ngClass]="{'active': selectedIndex === i}">
<a href="javascript:void()" (click)="onClick(i, step)" data-toggle="tab">{{step.stepLabel}}</a>
</li>
</ul>
and in Component.ts
onClick(index: number, step: any): void {
console.log(step); // here i want to console the title of the step clicked, in this case TEXT of this "<ng-template cdkStepLabel>Fill out your name 1</ng-template>"
this.selectedIndex = index;
}
How can I get the title that is stored in <ng-template cdkStepLabel>Fill out your name 1</ng-template>
?
This is any content of "Step 1"