我的假设是我的 css 不正确,但可惜我无法弄清楚。
<div *ngIf="loading">
<md-progress-circle mode="indeterminate" color="warn">Loading...</md-progress-circle>
</div>
<md-list>
<md-list-item *ngFor="let incident of incidents">
<h3 md-line> {{name}} </h3>
<p md-line>
<span>{{date}} > </span>
<span>{{text}}</span>
</p>
</md-list-item>
</md-list>
最佳答案
您需要确保您使用的是@angular/material 的主题。
Include the core and theme styles:
This is required to apply all of the core and theme styles to your application. You can either use a pre-built theme, or define your own custom theme.
- See the theming guide for instructions.
我发现在没有主题的情况下使用@angular/material 只能在某些时候起作用。文本输入有效,但单选按钮、复选框 - 看起来是微调器 - 需要主题才能正常工作。
如引用中所述,您可以使用提供的主题之一(目前提供 6 个)或创建您自己的主题。提供的主题可以使用 @import('~@angular/material/core/theming/prebuilt/<theme>.css')
包含在您的 css 中。 .
关于Angular2 Material2 <md-spinner> 未显示但正在工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41582139/