"""的含义是什么?在{{hero?.name}}

时间:2018-03-11 22:20:42

标签: angular

意味着什么"?"在以下代码中:

  <span [style.text-decoration]="lineThrough">
     {{prefix}} {{hero?.name}}
  </span>

我不明白&#34;?&#34;在{{hero?.name}}中。 此代码在Angular的文档中:    https://angular.io/guide/template-syntax#custom-events-with-eventemitter

由于

1 个答案:

答案 0 :(得分:0)

来自文档:

  

Angular安全导航操作员(?。)流畅方便   防止属性路径中的null和未定义值的方法。

阅读doc

相关问题