Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular material stepper next step showing create instead of 1

I am working on stepper, i want to disable next step until all filled should be filled so i made linear to true in html file

<mat-horizontal-stepper [linear]="true" #stepper>
        <mat-step [stepControl]="firstFormGroup">
          <form [formGroup]="firstFormGroup">

it's working fine but whenever i am going to next step, "1" becomes "cre" on inspecting i got

enter image description here

i didn't user create anywhere in my code it's coming from mat-icon

like image 941
Shiv Gaurav Avatar asked Jul 06 '18 16:07

Shiv Gaurav


2 Answers

you can set [completed]="false" on mat-step and you will have only numbers instead of icons.

or to replace the word "create" with the pen icon you need to add the google material font icon link:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons"rel="stylesheet">

like image 160
Fateme Fazli Avatar answered Oct 04 '22 07:10

Fateme Fazli


add #stepper in mat-horizontal-stepper

<mat-horizontal-stepper [linear]="true" #stepper>
....
</mat-horizontal-stepper>

then in .ts file get that stepper

@ViewChild('stepper') stepper: MatHorizontalStepper;

and lastly, do it in afterViewInit

ngAfterViewInit() {
  this.stepper._getIndicatorType = () => 'number';
}
like image 10
Saad Qamar Avatar answered Oct 04 '22 08:10

Saad Qamar