daily pastebin goal
3%
SHARE
TWEET

firebaseservice

a guest Jul 12th, 2018 244 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, Injectable } from '@angular/core';
  2. import { AngularFireDatabase } from 'angularfire2';
  3. import { Observable } from 'rxjs';
  4.  
  5. export class FirebaseService {
  6.  
  7.     constructor(private db: AngularFireDatabase ) {
  8.         /*const config = {
  9.             apiKey: "AIzaSyBJbsXXAi8dj_KEPIqdgMbFoopg_8YhENg",
  10.             authDomain: "dm122-346ce.firebaseapp.com",
  11.             databaseURL: "https://dm122-346ce.firebaseio.com",
  12.             projectId: "dm122-346ce",
  13.             storageBucket: "dm122-346ce.appspot.com",
  14.             messagingSenderId: "479270476172"
  15.           };
  16.           firebase.initializeApp(config) */
  17.     }
  18.  
  19.     // getOrdersRef() {
  20.  
  21.     //     let ordersRef =  firebase.database().ref('/orders').orderByChild('dataAtualizacao')
  22.     //     ordersRef.once("value")
  23.     //     .then(function(snapshot) {
  24.     //         console.log(snapshot.val())
  25.     //     });
  26.     //     return ordersRef;
  27.     // }
  28.  
  29.     getOrders():  AngularFireList<any> {
  30.         return this._af.database.list('/orders')
  31.     }
  32.  
  33.     // publiclistAccounts(): FirebaseListObservable<any[]>{
  34.     //     returnthis._af.database.list('/accounts');
  35.     //  }
  36.  
  37.     addOrder() {
  38.  
  39.     }
  40.  
  41.    
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top