I have multiple projects to manage:
export class Project {
$key: string;
file: File;
name: string;
title: string;
cat: string;
url: string;
progress: number;
createdAt: Date = new Date();
constructor(file: File) {
this.file = file;
}
}
All of these projects are uploaded here:
uploads: Observable<Project[]>;
private saveFileData(upload: Project) {
this.db.list(`profile/${this.auth.userId}/project`).push(upload);
}
When I try to access a specific project:
uploads: Observable<Project[]>;
getOne(){
this.uploads = this.db.list(`profile/${this.auth.userId}/project/${this.projectId}`);
}
However, I encounter an error with this.uploads
(Angularfirelist is not assignable to Observable.)
My attempt to resolve the issue was to change it to:
uploads: AngularFireList<Project[]>;
getOne(){
this.uploads = this.db.list(`profile/${this.auth.userId}/project/${this.projectId}`);
}
But then, a new error surfaced:
ERROR Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'
Any suggestions on how to retrieve that one specific project?