What is the difference between *ngIf and [hidden]?

后端 未结 6 1088
名媛妹妹
名媛妹妹 2020-11-30 06:14

Say I check it against and expression, then aren\'t these two same ?

{{val}}
6条回答
  •  Happy的楠姐
    2020-11-30 06:57

    *ngIf will include and remove the element from the DOM if set to true and false respectively. [hidden] in angular2 is the equivalent of ngshow and nghide that we had in AngularJS.It just shows and hides the element by add display:none and display:block.

提交回复
热议问题