当前位置: 首页>>代码示例>>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;未经允许,请勿转载。