ngShow如果插值子串等于某个子串

时间:2018-03-17 03:25:16

标签: angularjs substring ng-show

我有以下title,我希望show element if person == some value, e.g family。如何使用expression构建ngShow

<h2 class="mat-title" style="text-align:center;">Register as a {{person}}</h2>

1 个答案:

答案 0 :(得分:2)

您可以使用ng-if

<h2 ng-if="person==='family'" class="mat-title" style="text-align:center;">Register as a {{person}}</h2>