Angular2 Material2没有显示但正在工作

我的假设是我的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的主题.

getting started guide

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 07001 for instructions.

我发现使用没有主题的@ angular / material只能在某些时候使用.文本输入工作但无线电按钮,复选框 – 并且它似乎是微调器 – 需要主题才能正常工作.

如引用中所述,您可以使用其中一个提供的主题(目前提供6个主题)或创建自己的主题.使用@import(‘〜@ angular / material / core / theming / prebuilt /< theme> .css’)可以将提供的主题包含在您的CSS中.

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...