本文整理匯總了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();
}
示例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);
}
示例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');
}
示例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'];
}
});
}
}
示例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
});
});
}
示例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'));
}
示例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;
}
示例8:
.then(newUser => {
firebase
.database()
.ref('/workerList')
.child(newUser.uid)
.set({ email: email, name: name, abteilung: abteilung });
});
示例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);
}
});
示例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');
}