Web Developer

Section 2-5 Structure Directives

  1. *ngIf: only display element when the condition is true, such as: *ngIf = “condition”
  2. *ngFor: repeat display element for several time, such as: *ngFor = “let elem of elements; let i = index”, elements is an array, elem represent each element of an array from index 0, index is the index of an array

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>