Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

475
Vistas
md-list-icon or md-button aligned to right? (Angular Material 2)

Any way how to make buttons/icons/checkboxes aligned to the right like in Material 1:

Angular Material 1 list with actions https://material.angularjs.org/latest/demo/list

I currently (Material 2) have:

<md-list>
  <md-list-item *ngFor="let position of cart">
    <h3 md-line> {{ position.name }} </h3>
    <p md-line>
      <span> Line 1 </span>
    </p>
    <md-icon md-list-icon>delete</md-icon>
  </md-list-item>
</md-list>

Angular Material 2 list with actions

about 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

For what is described above the solution is pretty simple, simply omit mat-list-icon in your selector and Material will do the magic:

<mat-list>
  <mat-list-item *ngFor="let position of cart">
    <h3 mat-line> {{ position.name }} </h3>
    <p mat-line>
      <span> Line 1 </span>
    </p>
    <div> $2.00 </div>
    <button mat-icon-button (click)="remove(1)">
      <mat-icon class="mat-24">delete</mat-icon>
    </button>
  </mat-list-item>
</mat-list>

enter image description here

about 4 years ago · Santiago Trujillo Denunciar

0

Actually, mat-list uses flex box. You can individually order the item using the CSS property 'order'. Just use a large enough number for the order

md-icon[md-list-icon]{
  order: 10;
}
<md-list>
  <md-list-item *ngFor="let position of cart">
    <h3 md-line> {{ position.name }} </h3>
    <p md-line>
      <span> Line 1 </span>
    </p>
    <md-icon md-list-icon>delete</md-icon>
  </md-list-item>
</md-list>

about 4 years ago · Santiago Trujillo Denunciar

0

If anyone like me had this same problem and the suggested solutions didn't work out try this:

.icon-class {
    margin-left: auto;
}
<mat-list>
   <mat-list-item>
      {{"Im just a filler"}}
      <mat-icon class="icon-class">
          fiber_manual_record
      </mat-icon>
      <mat-divider></mat-divider>
    </mat-list-item>
<mat-list>

It worked for me, and when it did I got mad at myself for not figuring it out before

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda