import { Injectable } from '@angular/core' ; import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from 'angularfire2/firestore' ; import { Observable } from 'rxjs/Observable' ; import { Employee} from '../model/Employee' ; @Injectable () export class EmployeeService { userscollection: AngularFirestoreCollection<Employee>; users: Observable<Employee[]>; userDoc: AngularFirestoreDocument<Employee>; constructor( public _afs: AngularFirestore) { } getData() { this .userscollection = this ._afs.collection( 'employees' , x => x.orderBy( 'firstName' , 'asc' )); this .users = this .userscollection.snapshotChanges().map( changes => { return changes.map( a => { const data = a.payload.doc.data() as Employee; data.id = a.payload.doc.id; return data; }); }); return this .users; } insertEmployee( employee : Employee) { this ._afs.collection( 'employees' )...