1、遍历          *ngFor   *ngFor = "let product of products "

2、插值语法   {{ }}        <div> {{ }} </div>

3、属性绑定   [ ]           <a [title] = "product.name+'details'">

4、判断语法  *ngIf       *ngIf = "product.desription"

5、事件绑定  ()       <button (click) = "share()"> share </button>

注意:带有*号的语法,第二个单词第一个字母是大写。判断语法:当有一个值的属性为空时,是不会进行显示的。事件绑定:在绑定后面必须带有'()'小括号;

相关文章:

  • 2021-09-24
  • 2022-01-05
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2021-05-27
  • 2021-11-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-09-13
  • 2021-07-13
  • 2022-12-23
  • 2021-07-09
相关资源
相似解决方案