我只是按照这个例子(install and setup angularfire2),这是angularfire2的官方文档的一部分
当我运行这个例子时,我有以下错误。
正如你所看到的,我有两个错误,第一个我认为是与自动化有关的问题,以下我认为与某些操作无法完成有关。
代码正如示例所示。 数据库的规则是这样的:
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>
对这个问题有什么看法?
答案 0 :(得分:1)
设置时遇到了同样的错误:data step1;
set new (keep=id hour);
by id;
do hour = 0 to last_hour;
output;
end;
run;
proc sort data=step1;
by id hour;
run;
proc sql;
create table step2 as
select distinct a.id, a.hour, b.status
from step1 as a
left join new as b
on a.id = b.id
and a.hour = b.hour
order by a.id, a.hour;
quit;
data step3;
set step2;
by id hour;
retain previous_status;
if first.id then do;
previous_status = .;
if status > . then previous_status = status;
end;
if not first.id then do;
if status = . and previous_status > . then status = previous_status;
if status > . then previous_status = status;
end;
run;
确保从firebase配置文件中复制它。
它应该如下所示:authDomain: "localhost",