简体   繁体   中英

angular material 2 checkbox not working

Trying to add md-checkbox in a md-cell, so a select all at the top and individual checkbox in each row. Nothing is currently showing up, when I check source it shows the md-checkbox, but just displays the display value. Please help.

I used the example here for Select All

And here is my code:

<md-checkbox [(ngModel)]="selectAllChecked" (indeterminate)="selectAllIndeterminate" (click)="selectAllClicked()" ngDefaultControl>
        <span *ngIf="selectAllChecked">Un-</span>Select All
</md-checkbox>

selectAllChecked and selectAllIndeterminate are Booleans defaulting to false and the checkbox is still not displaying. It exists in the html, but just showing the display value.

我在@NgModule的imports部分中的app.module.ts中缺少导入。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM