在我的 Angular 应用程序中,Firebase 返回一个显示bad-app-name
为代码的错误。我在 angular 应用程序中使用 angularfire2。
我已经仔细检查了 Firebase 配置,没问题,那么如何解决这个错误。
app.components.ts
import { Component, OnInit } from '@angular/core';
import { FormsModule, NgForm } from "@angular/forms";
import { AngularFireDatabase } from "angularfire2/database";
import { Router } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent{
isLoggedIn: boolean = false;
courses: any[];
constructor(public db: AngularFireDatabase) {
db.list('/Courses').valueChanges().subscribe(courses => {
this.courses = courses;
console.log(this.courses);
});
}
login() {
this.isLoggedIn = !this.isLoggedIn;
}
user:any;
saveData(formData) {
if (formData.valid) …
Run Code Online (Sandbox Code Playgroud)