【发布时间】:2021-05-11 06:27:23
【问题描述】:
我有点卡住了。我正在尝试使用三元表达式编写 *ngIf else 语句 目标是写 *ngIf 如果用户已登录徽标 a href 会导致一个 Url 如果未登录 href 会导致另一个 URL。
https://stackblitz.com/edit/angular-ivy-oyyuxu?file=src%2Fapp%2Fapp.component.html
谢谢
【问题讨论】:
-
这样的?
<a href="{{ auth.loggedInUser ? 'https://www.google.com' : 'https://www.amazon.com' }}">
标签: angular typescript conditional-statements syntax-error angular11