Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Component, OnDestroy, OnInit} from '@angular/core';
- import {FirebaseService} from "../../services/firebase.service";
- import {AngularFireDatabase, FirebaseListObservable} from "angularfire2/database";
- @Component({
- selector: 'app-site-restaurants',
- templateUrl: './site-restaurants.component.html',
- styleUrls: ['./site-restaurants.component.scss']
- })
- export class SiteRestaurantsComponent implements OnInit, OnDestroy {
- public restaurants: FirebaseListObservable<any>;
- public tips: FirebaseListObservable<any>;
- constructor(private db: AngularFireDatabase) {
- this.restaurants = db.list('/restaurants');
- this.tips = db.list(`/restaurants/${key}/tips`);
- }
- deleteItem(key: string) {
- this.restaurants.remove(key);
- }
- ngOnInit() {
- }
- ngOnDestroy() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement