第一次使用 firestore 时出现此错误。根据我的研究,这似乎是 Ivy 的问题。我没有很多修改 tsconfig.app.json 的经验,这是我被指出的方向,遵循其他答案。
我能够从原始项目中修改的唯一一件事是使用 Angular Fire 6 而不是 5,这是我最初按照教程所做的。
这是 package.json:
{
"name": "language",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~9.0.1",
"@angular/cdk": "^9.0.0",
"@angular/common": "~9.0.1",
"@angular/compiler": "~9.0.1",
"@angular/core": "~9.0.1",
"@angular/fire": "^6.0.0-rc.1",
"@angular/flex-layout": "^9.0.0-beta.29",
"@angular/forms": "~9.0.1",
"@angular/material": "^9.0.0",
"@angular/platform-browser": "~9.0.1",
"@angular/platform-browser-dynamic": "~9.0.1",
"@angular/router": "~9.0.1",
"firebase": "^7.8.2",
"rxjs": "~6.5.4",
"rxjs-compat": "^6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": …Run Code Online (Sandbox Code Playgroud) 我正在使用firebase + angularjs应用程序,我正在使用简单的电子邮件和密码验证,它正常工作.
我只是想知道我是否可以在firebase email + password auth正在使用的用户表上添加额外的用户数据,就像我想添加有关用户的计费信息和其他详细信息而无需在firebase上创建额外的节点/表来存储这些额外的数据.
firebase angularfire firebasesimplelogin firebase-authentication
我有这个数据结构,其中todos被组织为遵循path/todos/uid /
{
"metausers" : {
"simplelogin:1" : {
"displayName" : "John Doe",
"provider" : "password",
"provider_id" : "1"
},
"simplelogin:2" : {
"displayName" : "GI Jane",
"provider" : "password",
"provider_id" : "2"
}
},
"todos" : {
"simplelogin:1" : {
"-JUAfv4_-ZUlH7JqM4WZ" : {
"completed" : false,
"done" : false,
"group" : false,
"private" : false,
"subject" : "First"
},
"-JUAfveXP_sqqX32jCJS" : {
"completed" : false,
"done" : false,
"group" : false,
"private" : true,
"subject" : "Second"
},
"-JUAfwXnMo6P53Qz6Fd2" …Run Code Online (Sandbox Code Playgroud) Terminal -
"WARNING in Invalid constructor parameter decorator in D:/New folder/SilverLife/node_modules/@angular/fire/fesm2015/angular-fire.js:
() => [
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
]
ERROR in getInternalNameOfClass() called on a non-ES5 class: expected
AngularFireModule to have an inner class declaration"
Run Code Online (Sandbox Code Playgroud)
我FirebaseSimpleLogin用来创建用户并处理身份验证.
当我尝试通过该$createUser()方法创建一个简单登录的新用户时,如果已经使用了电子邮件地址,firebase将不会创建用户.但是,$set()在创建它们之后,我还使用将创建的用户保存到我的firebase中,并将其user.uid用作密钥.当尝试写入数据库时,即使用户名不是唯一的,firebase也会保存记录,因为简单登录只需要电子邮件和密码.那么,当用户名不被用作用户对象的密钥时,如何验证用户名是否唯一?
我正在创建这样的新用户:
$scope.createUser = function() {
$scope.auth.$createUser('trinker@gmail.com', 'password').then(function(user, err) {
if (!err) {
ref.child('users/' + user.uid).set({
email: user.email,
username: user.username
});
console.log("success!");
}else{
console.log(err.message);
}
});
}
Run Code Online (Sandbox Code Playgroud)
我的用户对象如下所示:
{
"users" : {
"simplelogin:28" : {
"email" : "trinker@gmail.com",
"username" : "jtrinker"
},
"simplelogin:30" : {
"email" : "test@gmail.com",
"username" : "jtrinker"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我需要使用uid作为每个用户的密钥,但我仍然需要用户名是唯一的.
如果一个对象中的属性对于另一个对象内的属性不是唯一的,我怎么能阻止firebase保存记录?
angularjs firebase firebase-security angularfire firebase-realtime-database
我正在研究一个Angular App与Firebase实时数据库相关的问题.我目前正在使用AngularFire访问Firebase数据库.
在阅读Vanilla Firebase和AngularFire记录之后,在实现我的应用程序的某些部分之后,我看到Firebase数据库所需的所有内容都可以在Vanilla Firebase的帮助下实现,而无需任何帮助AngularFire.
此外,AngularFire与之相比,仅提供有限数量的资源Vanilla Firebase.那么,为什么我要使用它AngularFire,而不是Vanilla Firebase当它有许多资源可用时呢?我无法理解这种情况.
使用AngularFire结束有Vanilla Firebase什么好处?
angularjs firebase angularfire firebase-realtime-database angularfire2
当我运行 npm run start 时,出现以下有关 firebase 的错误。
技术:Angular 版本 9、Firebase、Firestore、Geofirestore Angular CLI。
错误:
ERROR in The target entry-point "@angular/fire/auth" has missing dependencies:
- firebase/auth
- firebase/app
Run Code Online (Sandbox Code Playgroud)
需要注意的依赖:
"@angular/cli": "~9.1.1",
"@angular/core": "~9.1.1",
"@angular/fire": "^5.1.1",
"firebase": "5.10.1",
"geofirestore": "3.2.3",
Run Code Online (Sandbox Code Playgroud)
包 json:
{
"name": "project",
"version": "1.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve -o",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
},
"private": true,
"dependencies": {
"@agm/core": "^1.1.0",
"@angular/animations": "~9.1.1",
"@angular/cdk": "^9.2.0",
"@angular/common": "~9.1.1", …Run Code Online (Sandbox Code Playgroud) 在 Angular 10 更新后,我收到了有关 Firebase 和 CommonJS 或 AMD 依赖项的这些警告!
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/src/app/app.component.ts depends on 'firebase'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/src/app/app.module.ts depends on '@angular/common/locales/fr'. When using the 'localize' option this import is not needed. Did you mean to import '@angular/common/locales/global/fr'? For more info see: https://angular.io/guide/i18n#import-global-variants-of-the-locale-data
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/src/app/services/crud/crud.service.ts depends on 'lodash/dropRight'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/node_modules/@angular/fire/__ivy_ngcc__/fesm2015/angular-fire.js depends on …Run Code Online (Sandbox Code Playgroud) 我有一个调用addCheckin()方法的页面,它位于控制器内部.在控制器中,我试图创建一个如下引用:
var ref = firebase.database().ref("users/" + $scope.whichuser + "/meetings/" +$scope.whichmeeting + "/checkins");
Run Code Online (Sandbox Code Playgroud)
$scope.whichuser并且$scope.whichmeeting是$routeParams,我从其他途径传递.这是我的签到控制器 -
myApp.controller("CheckinsController",
['$scope','$rootScope','$firebaseArray','$routeParams','$firebaseObject',
function($scope,$rootScope,$firebaseArray,$routeParams,$firebaseObject){
$scope.whichuser = $routeParams.uid;
$scope.whichmeeting = $routeParams.mid;
var ref = firebase.database().ref("users/" + $scope.whichuser + "/meetings/" +$scope.whichmeeting + "/checkins");
$scope.addCheckin = function(){
var checkinInfo = $firebaseArray(ref);
var data={
firstname:$scope.firstname,
lastname:$scope.lastname,
email:$scope.email,
date:firebase.database.ServerValue.TIMESTAMP
}
checkinInfo.$add(data);
}
}]);/*controller*/
Run Code Online (Sandbox Code Playgroud)
我在这里遇到两个错误 -
错误1:
Error: permission_denied at /users/Vp2P1MqKm7ckXqV2Uy3OzTnn6bB3/meetings: Client doesn't have permission to access the desired data.
错误2:
Error: permission_denied at /users/Vp2P1MqKm7ckXqV2Uy3OzTnn6bB3/meetings/-KT5tqMYKXsFssmcRLm6/checkins: Client …
angularjs firebase angularfire firebase-authentication firebase-realtime-database
使用 angularfire 时出现此错误。检查了我的进口,他们似乎是正确的。我曾尝试重新安装 angularfire,但它仍然抛出此错误。angularfire 有问题吗?
import { Injectable, NgZone } from '@angular/core';
import { User } from "../services/user";
import { auth } from 'firebase/app';
import { AngularFireAuth } from "@angular/fire/auth";
import { AngularFirestore, AngularFirestoreDocument } from '@angular/fire/firestore';
import { Router } from "@angular/router";
@Injectable({
providedIn: 'root'
})
export class AuthService {
userData: any; // Save logged in user data
constructor(
public afs: AngularFirestore, // Inject Firestore service
public afAuth: AngularFireAuth, // Inject Firebase auth service
public router: Router,
public ngZone: …Run Code Online (Sandbox Code Playgroud)