mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(table): add toggling to expandable rows example (#13897)
This commit is contained in:
committed by
Jeremy Elbourn
parent
4a7cb2b8ca
commit
6347ace05e
@@ -29,7 +29,7 @@
|
||||
<tr mat-row *matRowDef="let element; columns: columnsToDisplay;"
|
||||
class="example-element-row"
|
||||
[class.example-expanded-row]="expandedElement === element"
|
||||
(click)="expandedElement = element">
|
||||
(click)="expandedElement = expandedElement === element ? null : element">
|
||||
</tr>
|
||||
<tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="example-detail-row"></tr>
|
||||
</table>
|
||||
|
||||
@@ -19,7 +19,7 @@ import {animate, state, style, transition, trigger} from '@angular/animations';
|
||||
export class TableExpandableRowsExample {
|
||||
dataSource = ELEMENT_DATA;
|
||||
columnsToDisplay = ['name', 'weight', 'symbol', 'position'];
|
||||
expandedElement: PeriodicElement;
|
||||
expandedElement: PeriodicElement | null;
|
||||
}
|
||||
|
||||
export interface PeriodicElement {
|
||||
|
||||
Reference in New Issue
Block a user