Last active
April 24, 2019 18:31
-
-
Save bariscanyilmaz/ee86718356868359d7c248662006a8b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore'; | |
import { Category } from '../models/category.model'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class CategoryService { | |
constructor(private fireStore: AngularFirestore) { | |
} | |
getCategories(){ | |
return this.fireStore.collection('Categories').snapshotChanges(); | |
} | |
addCategory(category:Category){ | |
return this.fireStore.collection('Categories').add({...category}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment