docs(table): add toggling to expandable rows example (#13897)

This commit is contained in:
Gabriel Caruana
2018-11-29 16:44:29 +01:00
committed by Jeremy Elbourn
parent 4a7cb2b8ca
commit 6347ace05e
2 changed files with 2 additions and 2 deletions
@@ -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 {