我面對關於材料設計的官方文件的一些問題, 他們說如何禁用<MD-擴大面板> maetrial2 angular2
擴展面板使用禁用的屬性被禁用。禁用的擴展面板不能由用戶切換,但仍可以使用編程方式進行操作。
<mat-expansion-panel [disabled]="isDisabled">
<mat-expansion-panel-header>
This is the expansion title
</mat-expansion-panel-header>
<mat-panel-description>
This is a summary of the content
</mat-panel-description>
</mat-expansion-panel>
但是,當我想它拋出一些錯誤 -
Uncaught Error: Template parse errors:
Can't bind to 'disabled' since it isn't a known property of 'md-expansion-panel'.
1. If 'md-expansion-panel' is an Angular component and it has 'disabled' input, then verify that it is part of this module.
2. If 'md-expansion-panel' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<md-expansion-panel
[ERROR ->][disabled]="true"
routerLink="/settings/tools"
")
任何幫助嗎?
您是否可以更新您的問題以顯示Angular版本和Angular Material版本? – nicholaschris