我试图检查事件长度是否为0,如果大于2,则使用以下代码检查term.length,
<li class="more-result" *ngIf="events?.length == 0" && "term.value.length > 2">
<span class="tab-content-area-active-location">
No events found in {{selectedCountry}}
</span>
</li
&GT;
它在控制台上显示模板错误,
Unexpected closing tag "li" ("
答案 0 :(得分:3)
从
更改 ngIf 条件*ngIf="events?.length == 0" && "term.value.length > 2"
到
*ngIf="events?.length == 0 && term.value.length > 2"