【问题标题】:Parser Error in angular角度解析器错误
【发布时间】:2019-01-13 05:31:00
【问题描述】:
 <agm-marker  *ngFor="let k of marker|keyconductores" 
                  [latitude]="{{marker[k].lat}}" 
                  [longitude]="{{marker[k].lng}}" >
  </agm-marker>

错误 未捕获的错误:模板解析错误: 解析器错误:在 ng:///AppModule/MapaComponent.html@3:18 ("lng" >

【问题讨论】:

  • 您不能在 的 [latitude] 属性中添加 {{}} 登录,只需使用 [latitude]="k.clat" 因为 {{conductores[k].clat}} 是仅在视图中使用以显示其价值
  • 你能贴出你的管道键导体吗

标签: angular ngfor


【解决方案1】:

将值绑定到角度输入参数时无需使用大括号

<agm-marker  *ngFor="let item of conductores|keyconductores" 
                  [latitude]="item.clat" 
                  [longitude]="item.clng" >
  </agm-marker>

【讨论】:

  • 不起作用,例如:, ,如果我删除括号它是打印文字
  • 创建示例演示
猜你喜欢
  • 2020-06-15
  • 1970-01-01
  • 1970-01-01
  • 2023-03-26
  • 1970-01-01
  • 2020-09-02
  • 1970-01-01
  • 2019-10-09
  • 1970-01-01
相关资源
最近更新 更多