|
1 | | -<ng-content select="[mat-list-avatar],[matListAvatar],[mat-list-icon],[matListIcon]"></ng-content> |
2 | | - |
3 | | -<!-- If lines were explicitly given, use those as the text. --> |
4 | | -<ng-container *ngIf="lines.length"> |
5 | | - <span class="mdc-list-item__text"><ng-content select="[mat-line],[matLine]"></ng-content></span> |
6 | | -</ng-container> |
7 | | - |
8 | | -<!-- |
9 | | - If lines were not explicitly given, assume the remaining content is the text, otherwise assume it |
10 | | - is an action that belongs in the "meta" section. |
11 | | ---> |
12 | | -<span [class.mdc-list-item__text]="!lines.length" [class.mdc-list-item__meta]="!!lines.length"> |
| 1 | +<!-- Save icons and unclassified content to be places later --> |
| 2 | +<ng-template #icons> |
| 3 | + <ng-content select="[mat-list-avatar],[matListAvatar],[mat-list-icon],[matListIcon]"></ng-content> |
| 4 | +</ng-template> |
| 5 | +<ng-template #unsortedContent> |
13 | 6 | <ng-content></ng-content> |
14 | | -</span> |
| 7 | +</ng-template> |
15 | 8 |
|
| 9 | +<!-- Prefix --> |
| 10 | +<span class="mdc-list-item__graphic" *ngIf="checkboxPosition !== 'after' else icons"> |
| 11 | + <mat-pseudo-checkbox></mat-pseudo-checkbox> |
| 12 | +</span> |
| 13 | +<!-- Text --> |
| 14 | +<span class="mdc-list-item__text"> |
| 15 | + <ng-content *ngIf="lines.length else unsortedContent" select="[mat-line],[matLine]"></ng-content> |
| 16 | +</span> |
| 17 | +<!-- Suffix --> |
| 18 | +<span class="mdc-list-item__meta"> |
| 19 | + <span class="mdc-list-item__graphic" *ngIf="checkboxPosition === 'after' else icons"> |
| 20 | + <mat-pseudo-checkbox></mat-pseudo-checkbox> |
| 21 | + </span> |
| 22 | + <ng-container *ngIf="lines.length" [ngTemplateOutlet]="unsortedContent"></ng-container> |
| 23 | +</span> |
| 24 | +<!-- Divider --> |
16 | 25 | <ng-content select="mat-divider"></ng-content> |
0 commit comments