angularfire 相关问题

AngularFire是官方支持的Firebase的AngularJS绑定,它是一个云数据库,旨在为实时协作应用程序提供支持。因此,您不需要服务器来构建Angular应用程序。

未捕获的类型错误:n.auth 不是函数(Angular Firebase 应用程序)

我的 Angular 应用程序在本地运行没有错误,但是当我构建它并使用时: firebase 初始化托管 火力基地部署 它已部署,但仅加载索引,没有任何我的组件并抛出 t...

回答 1 投票 0

基于参数的多个 where 子句的 Firestore 查询

我想根据传入的参数使用多个 where 子句查询 Firestore 数据库。以下代码块有效: getProducts2(accountId: 字符串, 制造商?: 字符串,

回答 2 投票 0

Angularfire - 类型“User”上不存在属性“setCustomUserClaims”

我正在使用 Angular 17 和 AngularFire 17。我想设置自定义声明,以便我可以在身份验证中使用角色,但由于某种原因,User 对象似乎没有 setCustomUserClaims() 函数...

回答 1 投票 0

firebase firestore 在本地工作,但在角度部署时无法工作。错误:服务 firestore 不可用

我已将 @angular/fire 添加到我的项目中以使用 firestore,它在本地运行良好,并且正在写入 firestore。但是,当我将其部署到我的 firebase 托管时。它停止工作了。 不...

回答 1 投票 0

在 Angular 项目中安装 Firebase 时出现 E404 错误

目前我正在学习 Angular,我试图为我的项目安装 firebase,但我在终端中收到此错误消息: 在此输入图像描述 有人可以帮我吗,可能是什么

回答 1 投票 0

FirebaseError:缺少路由标头。请填写请求头,格式为 x-goog-request-params:project_id=example-2&database_id=test

Firestore 在 Angular Fire 7.5.0 上命名数据库 app.module.ts 上的 Angular Fire 配置 提供FirebaseApp(()=>初始化App(环境.firebase)), ProvideAuth(() => getAuth()),...

回答 1 投票 0

所有 Firebase 项目返回“权限缺失或不足”

尽管已将我的规则更改为以下内容,但我收到 FirebaseError:权限缺失或不足。还有其他原因 firestore 会返回此错误吗? `rules_version = '2'; 是...

回答 2 投票 0

嵌套的 Angular/RxJs switchMap 和 Angularfire firebase docData 调用两次而不是一次

我在 Angular 中使用 RxJS 有一个复杂的可观察链,并且我面临着嵌套 switchMap 和 docData 调用的意外行为。可观察链涉及丰富获取的活动...

回答 1 投票 0

如何在组件初始化中正确等待文档

当用户在会话中首次登录仪表板时,我遇到了这个问题。 登录后,我将用户重定向到私有视图,使用 t...

回答 1 投票 0

Angular Fire:如何在组件初始化中正确等待文档

当用户在会话中首次登录仪表板时,我遇到了这个问题。 登录后,我将用户重定向到私有视图,使用此服务从 Firestore 检索其数据...

回答 1 投票 0

由于某种原因,我无法使用@angular/fire 的存储(ANGULAR 16)

我对 Angular/Fire 有点陌生,我试图创建一个基本的应用程序来尝试它的一些功能。 Firestore 和 auth 似乎工作正常,但是当我尝试注入存储时,角度让我犯了这个错误......

回答 3 投票 0

ye.auth 不是函数@angular/fire

我正在使用 Angular 和 Firebase 进行身份验证。它在本地运行得很好,没有任何问题。但是,当我将应用程序部署到 Netlify 时,出现错误: 未捕获类型错误...

回答 2 投票 0

未捕获的 DOMException:无法在“WorkerGlobalScope”上执行“importScripts”

我正在尝试从以下位置导入脚本 importScripts("https://www.gstatic.com/firebasejs/9.1.0/firebase-app.js"); importScripts("https://www.gstatic.com/firebasejs/9.1.0/firebase-messagi...

回答 5 投票 0

Angular Firestore:将表数据保存到新集合/文档

我有一个应用程序,可以从用户集合中检索数据,其中clubId是外键(因为需要更好的术语)。 该应用程序获取每个clubId的所有用户的计数并显示信息...

回答 1 投票 0

Angular 16.2.0 中“firebase/auth”和“firebase/firestore”中出现 Angularfire 错误

我在 Angular 项目中使用了 Angularfire,当将 Angular 版本更新到 16.2.0 'firebase/auth' 和 'firebase/firestore' 时,抛出了几个错误。然后我进行了全新安装并进行了相同的操作...

回答 1 投票 0

无法使用角火储存。 FirebaseError:Firebase:未创建 Firebase 应用程序“[DEFAULT]” - 首先调用initializeApp()(应用程序/无应用程序)

我现在已经被困了好几天了。我需要进口角火存储。我认为我在初始化角度服务之前使用了它们。 应用程序模块.ts 从'@angular/core'导入{NgModule}; 导入 {

回答 1 投票 0

Firestore 更新错误:在 Firestore 更新操作中使用 arrayUnion

我当前在尝试通过使用 Firestore 的“arrayUnion”方法将元素添加到数组字段来更新 Firestore 文档时遇到问题。我在 Angular 应用程序中使用 Firestore...

回答 1 投票 0

@Angular/fire:错误 FirebaseError:预计 collection() 的第一个参数是 CollectionReference、DocumentReference 或 FirebaseFirestore

我在尝试读取 firestore 集合时遇到错误。我已经检查了 stackoverflow 上可用的解决方案,但仍然无法解决此问题。 我已经实施了...

回答 1 投票 0

在 Angular 16 中从 firebase 获取产品列表时出现问题

我正在尝试以表格格式显示产品列表。虽然我得到了表格标题,但我无法从 firebase 检索数据。 管理产品.component.html ... 我正在尝试以表格格式显示产品列表。虽然我得到了表格标题,但我无法从 firebase 检索数据。 admin-products.component.html <p> <a routerLink="/admin/products/new" class="btn btn-primary"> New Product</a> </p> <table class="table"> <thead> <tr> <th>Title</th> <th>Price</th> <th></th> </tr> </thead> <tbody> <tr *ngFor="let p of products$| async"> <td>{{ p.payload.val().title }}</td> <td>{{ p.payload.val().price }}</td> <td> <a [routerLink]="['/admin/products/', p.key]">Edit</a> </td> </tr> </tbody> </table> 产品.服务.ts import { Injectable } from '@angular/core'; import { AngularFireDatabase } from '@angular/fire/compat/database'; @Injectable({ providedIn: 'root' }) export class ProductService { constructor(private db: AngularFireDatabase) { } create(product) { this.db.list('/products ').push(product); } getAll() { return this.db.list('/product').snapshotChanges(); } } admin-product.component.ts import { Component } from '@angular/core'; import { ProductService } from 'src/app/product.service'; @Component({ selector: 'app-admin-products', templateUrl: './admin-products.component.html', styleUrls: ['./admin-products.component.css'] }) export class AdminProductsComponent { products$:any; constructor(private productService: ProductService){ this.products$ = this.productService.getAll(); } } 导出数据库json文件 { "categories": { "action": { "name": "Action" }, "adventure": { "name": "Adventure" }, "fighting": { "name": "Fighting" }, "puzzle": { "name": "Puzzle" }, "strategy": { "name": "Strategy" } }, "products ": { "-NdjCd4DNpztAOwiR1Hk": { "category": "Action", "imageUrl": "https://cdn.cloudflare.steamstatic.com/steam/apps/1888160/ss_549f55589c10866bc31243d277324e31ad155b29.600x338.jpg?t=1694077391", "price": 3599, "title": "ARMORED CORE™ VI FIRES OF RUBICON™" }, "-Ndu1DegkAnM2FWqx1tu": { "category": "Action", "description": "In space, no one can hear you scream … except your friends! Rally your crew, man your spaceship, and prepare for an epic adventure. Battle fearsome foes, salvage valuable loot, die repeatedly - while reclaiming humanity's lost territory together.", "imageUrl": "https://cdn.cloudflare.steamstatic.com/steam/apps/1063420/header.jpg?t=1694177016", "price": 2999, "title": "Void Crew" } 这些是 firebase 数据库和我的本地主机网页的图片 - 数据库中似乎没有 product 键,而只有 products 键。因此将 getAll() 方法更改为以下内容: getAll() { return this.db.list('/products ').snapshotChanges(); .pipe(map( action => action .map(a => { const key = a.payload.key; const data = a.payload.val(); return data; }))); } 然后在模板中执行以下操作: <tbody> <tr *ngFor="let p of products$| async"> <td>{{ p.title }}</td> <td>{{ p.price }}</td> <td> <a [routerLink]="['/admin/products/', p.key]">Edit</a> </td> </tr> </tbody>

回答 1 投票 0

错误@angular/fire构建错误地扩展了接口

我启动新的 Ionic/Angular 项目并添加 @Angular/Fire 包。 当我运行“ionicserve”时,出现以下错误: 错误:node_modules/@angular/fire/compat/firestore/interfaces.d.ts:13:18 - ...

回答 4 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.