Advertisement
BamiGorengo

Untitled

Sep 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import {Component, OnDestroy, OnInit} from '@angular/core';
  2. import {FirebaseService} from "../../services/firebase.service";
  3. import {AngularFireDatabase, FirebaseListObservable} from "angularfire2/database";
  4.  
  5.  
  6. @Component({
  7. selector: 'app-site-restaurants',
  8. templateUrl: './site-restaurants.component.html',
  9. styleUrls: ['./site-restaurants.component.scss']
  10. })
  11.  
  12.  
  13. export class SiteRestaurantsComponent implements OnInit, OnDestroy {
  14.  
  15. public restaurants: FirebaseListObservable<any>;
  16. public tips: FirebaseListObservable<any>;
  17.  
  18. constructor(private db: AngularFireDatabase) {
  19. this.restaurants = db.list('/restaurants');
  20. this.tips = db.list(`/restaurants/${key}/tips`);
  21. }
  22.  
  23. deleteItem(key: string) {
  24. this.restaurants.remove(key);
  25. }
  26.  
  27. ngOnInit() {
  28. }
  29.  
  30. ngOnDestroy() {
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement