小编Yar*_*rdi的帖子

如何在PrimeNG中点击后焦点或边框消失

我对 PrimeNg 还有另一个问题。单击按钮后我需要关闭边框。我尝试了很多方法:

host: {
    ::ng-deep .ui-button-icon-only{
        border: none!important;
        background-color: transparent!important;
        outline: none!important;
    }
}
Run Code Online (Sandbox Code Playgroud)

:focus即使我添加, 相同到.ng-star-inserted和,它也不起作用ng-star-inserted:focus

*:focus {
    outline: none!important;
    border: 0!important;
}
Run Code Online (Sandbox Code Playgroud)

该代码片段也不起作用,创建一个名为 nofocus 的新 scss 类并将其添加到按钮给我们带来零效果。我有:

照片

我说的是点击后的边框。

html sass primeng angular

8
推荐指数
1
解决办法
6707
查看次数

未处理的承诺拒绝:错误:收到消息 <get-frame-manager-configuration> 的错误响应

我的标题中出现了我一生中的第一次错误:未处理的承诺拒绝:错误:收到消息的错误响应。我不知道是什么导致了这个错误,但幸运的是我的应用程序中当前只有一个 api 调用。我打算添加一些 catch 或promise.all,但我不知道在哪里以及每次尝试都失败了。有我的代码:

组件.ts:

async ngOnInit(): Promise<void> {
    await this.attractionService.getAttractions().then((results) => {
      results.forEach((attraction: { id: number; name: string; description: string; type: string; distance: string | undefined; imagePath: string | undefined; }) => {
        this.section2ndModelAttractions.push(
          new Card(
            attraction.id,
            attraction.name,
            attraction.description,
            attraction.type,
            attraction.distance,
            attraction.imagePath
          )
        )
      })
    })
  }
Run Code Online (Sandbox Code Playgroud)

还有我的景点服务:

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { firstValueFrom } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class AttractionService {

  constructor(private http: HttpClient) { …
Run Code Online (Sandbox Code Playgroud)

api asynchronous promise typescript angular

5
推荐指数
0
解决办法
1331
查看次数

iOS Firebase - 如何检查用户是否未登录

我不想检查用户是否未登录我的应用程序。如果发生这种情况,我不想将他重定向到 notLoggedView 或 verifyAccuontView。

此时代码如下所示,如果用户未创建,我无法进入 notLoggedView。

override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(true);

        let user = Auth.auth().currentUser;

        if (user == nil) {
            self.performSegue(withIdentifier: "notLoggedView", sender: self);
        }
    }
Run Code Online (Sandbox Code Playgroud)

此代码的工作方式与上面相同(如用户存在,但 firebase 帐户为空)

override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(true);

        if let user = Auth.auth().currentUser {
            // action when account exist
        } else {
            self.performSegue(withIdentifier: "notLoggedView", sender: self);
        }
    }
Run Code Online (Sandbox Code Playgroud)

ios firebase swift firebase-authentication

4
推荐指数
1
解决办法
4337
查看次数