Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在登录AngularDart之前隐藏图像元素_Dart_Angular Dart_Dart Html_Dart Webui - Fatal编程技术网

如何在登录AngularDart之前隐藏图像元素

如何在登录AngularDart之前隐藏图像元素,dart,angular-dart,dart-html,dart-webui,Dart,Angular Dart,Dart Html,Dart Webui,我想在图像中隐藏登录按钮左侧的图像元素,它是登录前的图像显示。我怎样才能在安格拉达特做到这一点? app_component.html <div header class="custom-header"> <img class="icon" [src]="fbService.user?.photoURL"> <div id="user-name">{{fbService.user?.displayName}}</

我想在图像中隐藏登录按钮左侧的图像元素,它是登录前的图像显示。我怎样才能在安格拉达特做到这一点?

app_component.html

    <div header class="custom-header">
        <img class="icon" [src]="fbService.user?.photoURL">
        <div id="user-name">{{fbService.user?.displayName}}</div>
        <div id="email">{{fbService.user?.email}}</div>
     </div>


如果
isLoggedIn
是一个流


您需要一个全局服务,该服务提供
isLoggedIn
状态,并被注入到包含
元素的组件中(名为
authService

您能做到这一点吗?不,我使用的是FirebaseService,没有找到任何示例或文档来为“fbService.isLoggedIn”编写dart代码我明白了。如果我有时间,我会看看的。
.icon {
    width: 40px;
    height: 40px;
    margin-right: 16px;
}
<img *ngIf="authService.isLoggedIn" class="icon" [src]="fbService.user?.photoURL">
<img *ngIf="authService.isLoggedIn | stream" class="icon" [src]="fbService.user?.photoURL">