Ask Your Question
0

Can check-boxes be positioned to the left in Angular Material's mat-list options?

asked 2022-05-18 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-12-12 01:00:00 +0000

pufferfish gravatar image

Yes, check-boxes can be positioned to the left in Angular Material's mat-list options by adding the "mat-list-option" class to the list option and using the "mat-list-avatar" directive to place the check-box on the left.

For example, the following code will position the check-box on the left:

<mat-selection-list>
  <mat-list-option class="mat-list-option" *ngFor="let item of items">
    <mat-icon mat-list-icon>person</mat-icon>
    <div mat-list-avatar>
      <mat-checkbox [(ngModel)]="item.selected"></mat-checkbox>
    </div>
    {{ item.name }}
  </mat-list-option>
</mat-selection-list>
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-18 11:00:00 +0000

Seen: 13 times

Last updated: Dec 12 '21