使用材料设计2.0.0 beta8时,为什么图像无法正确渲染?

时间:2018-02-02 09:36:36

标签: javascript angular angular-material2 angular-directive angular-components

This is how the images are rendered

我已经尝试过浏览文档了。 我也在添加我的代码片段。

    <div class="container"
     fxLayout="column"
     fxLayoutGap="10px">

<md-list fxFlex>
  <md-list-item *ngFor="let dish of dishes">
    <img md-list-avatar src={{dish.image}} alt={{dish.name}}>
    <h1 md-line> {{dish.name}} </h1>
    <p md-line>
      <span> {{dish.description}} </span>
    </p>
  </md-list-item>
</md-list>

</div>

1 个答案:

答案 0 :(得分:0)

考虑到您正在发送正确的路径

,请尝试以下操作
<md-list fxFlex>
  <md-list-item *ngFor="let dish of dishes">
    <img md-list-avatar [src]="dish.image" alt={{dish.name}}>
    <h1 md-line> {{dish.name}} </h1>
    <p md-line>
      <span> {{dish.description}} </span>
    </p>
  </md-list-item>
</md-list>
相关问题