【发布时间】:2023-03-07 17:51:01
【问题描述】:
当来自 AngularJS 的指令值 {{auth?.loggedIn}} 为真或假时,我想在我的 HTML 中显示和隐藏 <button> 元素。
我的 HTML:
<button (click)="onLogin()" class="btn btn-lg btn-primary btn-block">SSO Login</button>
Currently Logged In? {{auth?.loggedIn}}
Logged in as: {{currentUser?.profile?.email}}
<button type="submit" class="btn btn-lg btn-primary" onclick="window.location.href='/secondpage'">Go to second page</button>
【问题讨论】:
-
你可以在你的元素上使用 *ngIf ``` *ngIf="expression" `` 在你的最后 ``` ``
标签: javascript html angularjs