0
AngularFire2注文が機能しません。query anglefire2で注文が機能しない
「注文」を更新するボタンがあります。スイッチケースの正しいケースがトリガされていますが、結果は最初の注文と同じです。
@Component({
selector: 'app-compact-research-report-list',
template: `
<loader *ngIf="!(allRRs$ | async)" [loading]=true [message]="'loading view...'"></loader>
<ul class="list-unstyled clearfix">
<li class="youtube-list-item" [@fadeIn] *ngFor="let rr of (allRRs$ | async)">
<app-compact-research-report [media]="rr"></app-compact-research-report>
</li>
</ul>
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CompactResearchReportListComponent implements OnInit {
public allRRs$: Observable<ResearchReport[]>;
ngOnInit() {
this.authService.reportDDBS$.subscribe((order) => {
console.log('Reportorder = ' + order);
switch (order) {
case 'uploadDate':
this.allRRs$ = this.dalService.this.afDb.list(`research_reports-published/`, ref => ref.orderByChild('uploadDate')).valueChanges();
break;
case 'filename':
this.allRRs$ = this.dalService.this.afDb.list(`research_reports-published/`, ref => ref.orderByChild('filename').valueChanges();
break;
case 'uploaderName':
this.allRRs$ = this.dalService.this.afDb.list(`research_reports-published/`, ref => ref.orderByChild('uploaderName').valueChanges();
break;
case 'revDownloads':
this.allRRs$ = this.dalService.this.afDb.list(`research_reports-published/`, ref => ref.orderByChild('revDownloads').valueChanges();
break;
default:
this.allRRs$ = this.dalService.this.afDb.list(`research_reports-published/`, ref => ref.orderByChild('uploadDate').valueChanges();
}
});
}
}