wrong icon in material angular stepper









up vote
1
down vote

favorite












I'm trying to put a edit icon when a state is "address", but the icon is the must of the first state (home).



I try:



First step:



<ng-template matStepperIcon="edit">
<mat-icon>home</mat-icon>
</ng-template>

<mat-step label="Antes de começar..." state="home">
..........


Second step:



<ng-template matStepperIcon="address">
<mat-icon>edit</mat-icon>
</ng-template>

<mat-step label="Dados do seu pet..." [stepControl]="secondFormGroup" state="address">
<div>
<button mat-button matStepperPrevious>Back</button>
<button mat-button matStepperNext>Next</button>
</div>


This is showing:



enter image description here



The second step must be a edit icon but have the icon of the first step why?










share|improve this question

























    up vote
    1
    down vote

    favorite












    I'm trying to put a edit icon when a state is "address", but the icon is the must of the first state (home).



    I try:



    First step:



    <ng-template matStepperIcon="edit">
    <mat-icon>home</mat-icon>
    </ng-template>

    <mat-step label="Antes de começar..." state="home">
    ..........


    Second step:



    <ng-template matStepperIcon="address">
    <mat-icon>edit</mat-icon>
    </ng-template>

    <mat-step label="Dados do seu pet..." [stepControl]="secondFormGroup" state="address">
    <div>
    <button mat-button matStepperPrevious>Back</button>
    <button mat-button matStepperNext>Next</button>
    </div>


    This is showing:



    enter image description here



    The second step must be a edit icon but have the icon of the first step why?










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm trying to put a edit icon when a state is "address", but the icon is the must of the first state (home).



      I try:



      First step:



      <ng-template matStepperIcon="edit">
      <mat-icon>home</mat-icon>
      </ng-template>

      <mat-step label="Antes de começar..." state="home">
      ..........


      Second step:



      <ng-template matStepperIcon="address">
      <mat-icon>edit</mat-icon>
      </ng-template>

      <mat-step label="Dados do seu pet..." [stepControl]="secondFormGroup" state="address">
      <div>
      <button mat-button matStepperPrevious>Back</button>
      <button mat-button matStepperNext>Next</button>
      </div>


      This is showing:



      enter image description here



      The second step must be a edit icon but have the icon of the first step why?










      share|improve this question













      I'm trying to put a edit icon when a state is "address", but the icon is the must of the first state (home).



      I try:



      First step:



      <ng-template matStepperIcon="edit">
      <mat-icon>home</mat-icon>
      </ng-template>

      <mat-step label="Antes de começar..." state="home">
      ..........


      Second step:



      <ng-template matStepperIcon="address">
      <mat-icon>edit</mat-icon>
      </ng-template>

      <mat-step label="Dados do seu pet..." [stepControl]="secondFormGroup" state="address">
      <div>
      <button mat-button matStepperPrevious>Back</button>
      <button mat-button matStepperNext>Next</button>
      </div>


      This is showing:



      enter image description here



      The second step must be a edit icon but have the icon of the first step why?







      angular material






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 17:26









      Renato Veronese

      317




      317






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You should be overriding the home icon, change matStepperIcon="address" to the following.



          <ng-template matStepperIcon="home">
          <mat-icon>edit</mat-icon>
          </ng-template>


          Revision



          You will need to control the icon override by state, please review the phone and chat states in the below material stackblitz example.



          https://stackblitz.com/angular/onvqbjrynkj?file=app%2Fstepper-states-example.html



          Revision 2



          You could also use *ngIf based on index.



          <ng-template matStepperIcon="edit" let-index="index">
          <mat-icon *ngIf="index == 0">home</mat-icon>
          <mat-icon *ngIf="index == 1">edit</mat-icon>
          </ng-template>





          share|improve this answer






















          • I change to the following code, but the icon still is a home in a second step
            – Renato Veronese
            Nov 10 at 18:00










          • please see revision
            – Marshal
            Nov 10 at 18:33










          • I just tried this too.. Changed the <mat-step state="home" label="Antes de começar..."> and <mat-step state="address" label="Dados do seu pet..." [stepControl]="secondFormGroup"> and before the </mat-step> i put: <ng-template matStepperIcon="home"> <mat-icon>home</mat-icon> </ng-template> <ng-template matStepperIcon="address"> <mat-icon>edit</mat-icon> </ng-template>
            – Renato Veronese
            Nov 10 at 18:37










          • still dont work. i see that in this tutorial they import MAT_STEPPER_GLOBAL_OPTIONS from '@angular/cdk/stepper'; but if i try to import, i receive: [ts] Module '"c:/Users/renaotpls/Documents/git clone/cade-meu-pet-frontend/node_modules/@angular/cdk/stepper"' has no exported member 'MAT_STEPPER_GLOBAL_OPTIONS'. my angular material is actualy in the latest version. i do no what i have to do.
            – Renato Veronese
            Nov 10 at 18:38






          • 1




            working in revision 2
            – Renato Veronese
            Nov 10 at 18:56










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241553%2fwrong-icon-in-material-angular-stepper%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          You should be overriding the home icon, change matStepperIcon="address" to the following.



          <ng-template matStepperIcon="home">
          <mat-icon>edit</mat-icon>
          </ng-template>


          Revision



          You will need to control the icon override by state, please review the phone and chat states in the below material stackblitz example.



          https://stackblitz.com/angular/onvqbjrynkj?file=app%2Fstepper-states-example.html



          Revision 2



          You could also use *ngIf based on index.



          <ng-template matStepperIcon="edit" let-index="index">
          <mat-icon *ngIf="index == 0">home</mat-icon>
          <mat-icon *ngIf="index == 1">edit</mat-icon>
          </ng-template>





          share|improve this answer






















          • I change to the following code, but the icon still is a home in a second step
            – Renato Veronese
            Nov 10 at 18:00










          • please see revision
            – Marshal
            Nov 10 at 18:33










          • I just tried this too.. Changed the <mat-step state="home" label="Antes de começar..."> and <mat-step state="address" label="Dados do seu pet..." [stepControl]="secondFormGroup"> and before the </mat-step> i put: <ng-template matStepperIcon="home"> <mat-icon>home</mat-icon> </ng-template> <ng-template matStepperIcon="address"> <mat-icon>edit</mat-icon> </ng-template>
            – Renato Veronese
            Nov 10 at 18:37










          • still dont work. i see that in this tutorial they import MAT_STEPPER_GLOBAL_OPTIONS from '@angular/cdk/stepper'; but if i try to import, i receive: [ts] Module '"c:/Users/renaotpls/Documents/git clone/cade-meu-pet-frontend/node_modules/@angular/cdk/stepper"' has no exported member 'MAT_STEPPER_GLOBAL_OPTIONS'. my angular material is actualy in the latest version. i do no what i have to do.
            – Renato Veronese
            Nov 10 at 18:38






          • 1




            working in revision 2
            – Renato Veronese
            Nov 10 at 18:56














          up vote
          2
          down vote



          accepted










          You should be overriding the home icon, change matStepperIcon="address" to the following.



          <ng-template matStepperIcon="home">
          <mat-icon>edit</mat-icon>
          </ng-template>


          Revision



          You will need to control the icon override by state, please review the phone and chat states in the below material stackblitz example.



          https://stackblitz.com/angular/onvqbjrynkj?file=app%2Fstepper-states-example.html



          Revision 2



          You could also use *ngIf based on index.



          <ng-template matStepperIcon="edit" let-index="index">
          <mat-icon *ngIf="index == 0">home</mat-icon>
          <mat-icon *ngIf="index == 1">edit</mat-icon>
          </ng-template>





          share|improve this answer






















          • I change to the following code, but the icon still is a home in a second step
            – Renato Veronese
            Nov 10 at 18:00










          • please see revision
            – Marshal
            Nov 10 at 18:33










          • I just tried this too.. Changed the <mat-step state="home" label="Antes de começar..."> and <mat-step state="address" label="Dados do seu pet..." [stepControl]="secondFormGroup"> and before the </mat-step> i put: <ng-template matStepperIcon="home"> <mat-icon>home</mat-icon> </ng-template> <ng-template matStepperIcon="address"> <mat-icon>edit</mat-icon> </ng-template>
            – Renato Veronese
            Nov 10 at 18:37










          • still dont work. i see that in this tutorial they import MAT_STEPPER_GLOBAL_OPTIONS from '@angular/cdk/stepper'; but if i try to import, i receive: [ts] Module '"c:/Users/renaotpls/Documents/git clone/cade-meu-pet-frontend/node_modules/@angular/cdk/stepper"' has no exported member 'MAT_STEPPER_GLOBAL_OPTIONS'. my angular material is actualy in the latest version. i do no what i have to do.
            – Renato Veronese
            Nov 10 at 18:38






          • 1




            working in revision 2
            – Renato Veronese
            Nov 10 at 18:56












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          You should be overriding the home icon, change matStepperIcon="address" to the following.



          <ng-template matStepperIcon="home">
          <mat-icon>edit</mat-icon>
          </ng-template>


          Revision



          You will need to control the icon override by state, please review the phone and chat states in the below material stackblitz example.



          https://stackblitz.com/angular/onvqbjrynkj?file=app%2Fstepper-states-example.html



          Revision 2



          You could also use *ngIf based on index.



          <ng-template matStepperIcon="edit" let-index="index">
          <mat-icon *ngIf="index == 0">home</mat-icon>
          <mat-icon *ngIf="index == 1">edit</mat-icon>
          </ng-template>





          share|improve this answer














          You should be overriding the home icon, change matStepperIcon="address" to the following.



          <ng-template matStepperIcon="home">
          <mat-icon>edit</mat-icon>
          </ng-template>


          Revision



          You will need to control the icon override by state, please review the phone and chat states in the below material stackblitz example.



          https://stackblitz.com/angular/onvqbjrynkj?file=app%2Fstepper-states-example.html



          Revision 2



          You could also use *ngIf based on index.



          <ng-template matStepperIcon="edit" let-index="index">
          <mat-icon *ngIf="index == 0">home</mat-icon>
          <mat-icon *ngIf="index == 1">edit</mat-icon>
          </ng-template>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 10 at 18:49

























          answered Nov 10 at 17:57









          Marshal

          947313




          947313











          • I change to the following code, but the icon still is a home in a second step
            – Renato Veronese
            Nov 10 at 18:00










          • please see revision
            – Marshal
            Nov 10 at 18:33










          • I just tried this too.. Changed the <mat-step state="home" label="Antes de começar..."> and <mat-step state="address" label="Dados do seu pet..." [stepControl]="secondFormGroup"> and before the </mat-step> i put: <ng-template matStepperIcon="home"> <mat-icon>home</mat-icon> </ng-template> <ng-template matStepperIcon="address"> <mat-icon>edit</mat-icon> </ng-template>
            – Renato Veronese
            Nov 10 at 18:37










          • still dont work. i see that in this tutorial they import MAT_STEPPER_GLOBAL_OPTIONS from '@angular/cdk/stepper'; but if i try to import, i receive: [ts] Module '"c:/Users/renaotpls/Documents/git clone/cade-meu-pet-frontend/node_modules/@angular/cdk/stepper"' has no exported member 'MAT_STEPPER_GLOBAL_OPTIONS'. my angular material is actualy in the latest version. i do no what i have to do.
            – Renato Veronese
            Nov 10 at 18:38






          • 1




            working in revision 2
            – Renato Veronese
            Nov 10 at 18:56
















          • I change to the following code, but the icon still is a home in a second step
            – Renato Veronese
            Nov 10 at 18:00










          • please see revision
            – Marshal
            Nov 10 at 18:33










          • I just tried this too.. Changed the <mat-step state="home" label="Antes de começar..."> and <mat-step state="address" label="Dados do seu pet..." [stepControl]="secondFormGroup"> and before the </mat-step> i put: <ng-template matStepperIcon="home"> <mat-icon>home</mat-icon> </ng-template> <ng-template matStepperIcon="address"> <mat-icon>edit</mat-icon> </ng-template>
            – Renato Veronese
            Nov 10 at 18:37










          • still dont work. i see that in this tutorial they import MAT_STEPPER_GLOBAL_OPTIONS from '@angular/cdk/stepper'; but if i try to import, i receive: [ts] Module '"c:/Users/renaotpls/Documents/git clone/cade-meu-pet-frontend/node_modules/@angular/cdk/stepper"' has no exported member 'MAT_STEPPER_GLOBAL_OPTIONS'. my angular material is actualy in the latest version. i do no what i have to do.
            – Renato Veronese
            Nov 10 at 18:38






          • 1




            working in revision 2
            – Renato Veronese
            Nov 10 at 18:56















          I change to the following code, but the icon still is a home in a second step
          – Renato Veronese
          Nov 10 at 18:00




          I change to the following code, but the icon still is a home in a second step
          – Renato Veronese
          Nov 10 at 18:00












          please see revision
          – Marshal
          Nov 10 at 18:33




          please see revision
          – Marshal
          Nov 10 at 18:33












          I just tried this too.. Changed the <mat-step state="home" label="Antes de começar..."> and <mat-step state="address" label="Dados do seu pet..." [stepControl]="secondFormGroup"> and before the </mat-step> i put: <ng-template matStepperIcon="home"> <mat-icon>home</mat-icon> </ng-template> <ng-template matStepperIcon="address"> <mat-icon>edit</mat-icon> </ng-template>
          – Renato Veronese
          Nov 10 at 18:37




          I just tried this too.. Changed the <mat-step state="home" label="Antes de começar..."> and <mat-step state="address" label="Dados do seu pet..." [stepControl]="secondFormGroup"> and before the </mat-step> i put: <ng-template matStepperIcon="home"> <mat-icon>home</mat-icon> </ng-template> <ng-template matStepperIcon="address"> <mat-icon>edit</mat-icon> </ng-template>
          – Renato Veronese
          Nov 10 at 18:37












          still dont work. i see that in this tutorial they import MAT_STEPPER_GLOBAL_OPTIONS from '@angular/cdk/stepper'; but if i try to import, i receive: [ts] Module '"c:/Users/renaotpls/Documents/git clone/cade-meu-pet-frontend/node_modules/@angular/cdk/stepper"' has no exported member 'MAT_STEPPER_GLOBAL_OPTIONS'. my angular material is actualy in the latest version. i do no what i have to do.
          – Renato Veronese
          Nov 10 at 18:38




          still dont work. i see that in this tutorial they import MAT_STEPPER_GLOBAL_OPTIONS from '@angular/cdk/stepper'; but if i try to import, i receive: [ts] Module '"c:/Users/renaotpls/Documents/git clone/cade-meu-pet-frontend/node_modules/@angular/cdk/stepper"' has no exported member 'MAT_STEPPER_GLOBAL_OPTIONS'. my angular material is actualy in the latest version. i do no what i have to do.
          – Renato Veronese
          Nov 10 at 18:38




          1




          1




          working in revision 2
          – Renato Veronese
          Nov 10 at 18:56




          working in revision 2
          – Renato Veronese
          Nov 10 at 18:56

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241553%2fwrong-icon-in-material-angular-stepper%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Barbados

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3