I am trying to write a query that will extract a single item from a collection based on it's key.
I have been searching and following alot of tutorials, but everything seems to just show how to get a list like below:
I would like to pass in the $key and query and pull a single record. Any suggestions or direction to a source that could help would be appreciated.
import { Injectable } from '@angular/core';
import { Customer } from "./customer";
import { AngularFire, FirebaseListObservable} from 'angularfire2';
@Injectable()
export class CustomerService {
customer: Customer;
customers: FirebaseListObservable<Customer[]>;
categories: FirebaseListObservable<Category[]>;
constructor(private af: AngularFire) { }
getCustomer(customerIndex: number) {
this.customers = this.af.database.list('customer');
return this.customers;
}
}