我只要按照该示例(install and setup angularfire2),其的angularfire2验证异常在基本的例子具有角2和火力
的公报文档的一部分而作为我运行这个例子中我有下面的错误。
正如你可以看到我有两个错误,第一个我想是一些有关如何与autorization,我想用一些操作不完成以及相关以下。
代码与上例完全相同。 和数据库的规则是这样的:
main.ts
import { bootstrap } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppComponent, environment } from './app/';
import { FIREBASE_PROVIDERS, defaultFirebase } from 'angularfire2';
if (environment.production) {
enableProdMode();
}
bootstrap(AppComponent,[
FIREBASE_PROVIDERS,
defaultFirebase({ //this data is replace with false data
apiKey: "apiKey",
authDomain: "localhost",
databaseURL: "https://databaseUrl/",
storageBucket: "gs://storageBucket",
})
]);
app.component.ts
import { Component } from '@angular/core';
import { AngularFire, FirebaseListObservable } from 'angularfire2';
@Component({
moduleId: module.id,
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css']
})
export class AppComponent {
title = 'app works!';
heroes : FirebaseListObservable<any[]>;
constructor(af: AngularFire) {
this.heroes = af.database.list('SuperHeroes');
}
}
app.component.html
<h1>
{{title}}
</h1>
<ul *ngFor="let hero of heroes | async">
<li class="text">
{{hero.name}}
</li>
</ul>
有关这个问题的任何想法? authDomain: "localhost",
确保你从复制火力简介:
设置的jsfiddle什么的,所以我们可以看到当前解决方案 – adolfosrs
@adolfosrs做 –
没有理由包括图像,'app.component'和'main.ts'就足够了。你的'jsfidle'坏了。 –