2016-07-14 37 views
1

我只要按照该示例(install and setup angularfire2),其的angularfire2验证异常在基本的例子具有角2和火力

的公报文档的一部分而作为我运行这个例子中我有下面的错误。

enter image description here

正如你可以看到我有两个错误,第一个我想是一些有关如何与autorization,我想用一些操作不完成以及相关以下。

代码与上例完全相同。 和数据库的规则是这样的:

enter image description here

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",

确保你从复制火力简介:

+0

设置的jsfiddle什么的,所以我们可以看到当前解决方案 – adolfosrs

+0

@adolfosrs做 –

+0

没有理由包括图像,'app.component'和'main.ts'就足够了。你的'jsfidle'坏了。 –

回答

1

我设置了时同样的错误。 它应该看起来像:<your.app.name>.firebaseapp.com"

+0

是的,那是错误,谢谢。但“错误:操作超时”的错误。这是正常的 ?我想是与firebase的异步相关的东西,但我来自java,所有这些新的web工作人员是我的新。 –

+0

我记得有这个错误,我不知道它是如何消失的,我的版本是'“angularfire2”:“2.0.0-beta.2”,“firebase”:“^ 3.0.5”,'也'af'取决于RC2 ... –