Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

480
Views
md-list-icon o md-button alineado a la derecha? (Material angular 2)

De cualquier forma, cómo hacer que los botones/iconos/casillas de verificación estén alineados a la derecha como en el Material 1:

Lista de material angular 1 con acciones https://material.angularjs.org/latest/demo/list

Actualmente (Material 2) tengo:

 <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>

Lista de material angular 2 con acciones

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Para lo que se describe arriba, la solución es bastante simple, simplemente omita mat-list-icon en su selector y Material hará la magia:

 <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>

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Trujillo Report

0

En realidad, mat-list usa flex box. Puede ordenar individualmente el artículo usando la propiedad CSS 'pedir'. Solo use un número lo suficientemente grande para el pedido

 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 Report

0

Si alguien como yo tuvo el mismo problema y las soluciones sugeridas no funcionaron, intente esto:

 .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>

Funcionó para mí, y cuando lo hizo, me enojé conmigo mismo por no haberlo descubierto antes.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!