當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript firebase.database函數代碼示例

本文整理匯總了TypeScript中firebase.database函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript database函數的具體用法?TypeScript database怎麽用?TypeScript database使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了database函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

 constructor(public nav: NavController) {
   this.fireAuth = firebase.auth();
   this.userProfile = firebase.database().ref('/userProfile');
   this.userData = firebase.database().ref('/userData');
   this.facebookAuth = new firebase.auth.FacebookAuthProvider();
   this.googleAuth = new firebase.auth.GoogleAuthProvider();
 }
開發者ID:junaidahmed93,項目名稱:Ionic2-With-Firebase3-Authentication,代碼行數:7,代碼來源:auth-data.ts

示例2: constructor

  constructor() {
    this.uId = firebase.auth().currentUser.uid;
 
    this.tracktorsQuery = firebase.database().ref('tracktors/')
      .limitToLast(100);


    this.fieldsQuery = firebase.database().ref('fields/')
      .limitToLast(100);

      
    
  }
開發者ID:carmelneta,項目名稱:nirim,代碼行數:13,代碼來源:user-data.ts

示例3: init

    init() {
      const fbConf = {
        apiKey: "AIzaSyD44soNIK81xzRjQXZ2Lmlb03CBIx4zVY4",
        authDomain: "fir-app-f088c.firebaseapp.com",
        databaseURL: "https://fir-app-f088c.firebaseio.com",
        storageBucket: "fir-app-f088c.appspot.com"
      };

      firebase.initializeApp(fbConf);

      this.db = firebase.database().ref('/');
      this.staticData = firebase.database().ref('/static');
      this.privateData = firebase.database().ref('/private');
    }
開發者ID:colinjlacy,項目名稱:firebase-ionic-2-demo,代碼行數:14,代碼來源:data.service.ts

示例4: constructor

    constructor(
        private http: Http,
        private user: User
    ) {

      if ('Notification' in window) {
        this.messaging = firebase.messaging();
        this.db = firebase.database();

        if (user.admin) {
          this.requestPermission();
        }


        this.messaging.onMessage((payload) => {
          if ( payload && payload['notification'] ) {
            if ( payload['notification']['title'] == 'LiveChat') return;
            alert(payload['notification']['title'] + "\n" + payload['notification']['body']);
            location.href = payload['notification']['click_action'];
          }
        });

      }

    }
開發者ID:thruthesky,項目名稱:english,代碼行數:25,代碼來源:message.ts

示例5: initRetro

 initRetro(retroUid: string) {
   this.retroUid = retroUid;
   return firebase.database().ref(`retros/${this.retroUid}`).transaction((retro) => {
     if (!retro) {
       retro = {
         buckets: {
           '1': {
             color: '#ffff8d',
             icon: 'start',
             name: 'Start doing'
           },
           '2': {
             color: '#a7ffeb',
             icon: 'continue',
             name: 'Continue'
           },
           '3': {
             color: '#ff8a80',
             icon: 'stop',
             name: 'Stop doing'
           }
         },
         step: 'ADD_ITEMS'
       };
     }
     return retro;
   }).then(() => {
     this.ref(`participants/${this.currentUser.uid}`).set({
       name: this.currentUser.displayName,
       email: this.currentUser.email,
       photoURL: this.currentUser.photoURL || this.defaultPhothoURL
     });
   });
 }
開發者ID:eskypl,項目名稱:retroanywhere,代碼行數:34,代碼來源:firebase.service.ts

示例6: constructor

  	constructor(private nav: NavController, public af: AngularFire) {
  		this.map = null;
  		this.loadMap();

  		this.ref = firebase.database().ref();
		this.ftLocation = new GeoFire(this.ref.child('_geofire'));
  	}
開發者ID:wespiper,項目名稱:foodTruckFinder,代碼行數:7,代碼來源:map.ts

示例7: constructor

 constructor(public af: AngularFire) {
     this.ref = firebase.database().ref();
     this.gfLocation = new GeoFire(this.ref.child('_geofire'));
     this.initList();
     this.items = [];
     this.geoQuery = null;
 }
開發者ID:wespiper,項目名稱:foodTruckFinder,代碼行數:7,代碼來源:test-list.ts

示例8:

 .then(newUser => {
   firebase
     .database()
     .ref('/workerList')
     .child(newUser.uid)
     .set({ email: email, name: name, abteilung: abteilung });
 });
開發者ID:getlabs,項目名稱:bretapp,代碼行數:7,代碼來源:auth.ts

示例9: function

    firebase.auth().onAuthStateChanged((user) => {
      if (user) {
        // If there's a user take him to the home page.
        //this.nav.setRoot(TabsPage);
        this.currentUser = user;
        this.userProfile = firebase.database().ref('/userProfile');
        var that = this;
        var ref = this.userProfile.child(firebase.auth().currentUser.uid);

        ref.once("value", function(snapshot) {
          if(!snapshot.exists() ||
              !snapshot.child("birthDate").exists() ||
              !snapshot.child("fitness").exists() ||
              !snapshot.child("goal").exists() ||
              !snapshot.child("height").exists() ||
              !snapshot.child("mealType").exists() ||
              !snapshot.child("sex").exists() ||
              !snapshot.child("weight").exists()) {
            //that.nav.setRoot(OnboardingPage);
          }
          else {
            //that.nav.setRoot(TabsPage);
          }
        });
      } else {
        // If there's no user logged in send him to the LoginPage
        //this.nav.setRoot(LoginPage);
      }
    });
開發者ID:marcusgraf,項目名稱:a3,代碼行數:29,代碼來源:app.ts

示例10: constructor

  constructor(public nav: NavController) {
    //creates a firebase auth reference, now you can get access to all the auth methods with this.fireAuth
    this.fireAuth = firebase.auth();
    //creating a database reference to the userProfile node on my firebase database.
    this.userProfile = firebase.database().ref('/userProfile');

  }
開發者ID:gdessard,項目名稱:handballStats,代碼行數:7,代碼來源:auth-data.ts


注:本文中的firebase.database函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。