本文整理汇总了TypeScript中angularfire2.FirebaseListObservable.add方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseListObservable.add方法的具体用法?TypeScript FirebaseListObservable.add怎么用?TypeScript FirebaseListObservable.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angularfire2.FirebaseListObservable
的用法示例。
在下文中一共展示了FirebaseListObservable.add方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(public af:AngularFire) {
var ref = new Firebase(rootFirebase);
ref.remove();
this.questions = af.list('/questions');
this.questions.add({question: 'why?'});
this.questions.add({question: 'how?'});
}
示例2:
handler: () => {
// send message implementation
console.log('Your Contact no. '+contactNo.value.toString()+' is saved!');
console.log('Your Message '+newMsg.value.toString()+' is saved!');
newMsg = newMsg.value.toString();
contactNo = contactNo.value.toString();
//console.log(newMsg);
//console.log(contactNo);
//console.log('this.sms.key.value');
//console.log(this.contacts.key.value);
/*
this.sms.once('value',function(snapshot){
var key = childSnapshot.key();
var childData = childSnapshot.val();
});});
*/
this.sms.add(newMsg);
this.contacts.add(contactNo);
SMS.send(contactNo,newMsg);
var success = Alert.create({
title: 'Message Sent Successfully'
});
this.nav.present(success);
}}]}); this.nav.present(confirm);}}
示例3: addTask
addTask(task : HTMLInputElement): void {
console.log(`Adding article title: ${task.value} `);
this.tasks.add(task.value);
}
示例4:
handler : data => {
// var obj = {
// task : JSON.stringify(data),
// id: Date.now()
// }
this.arr.add(data);
}
示例5:
buttons: [{text: 'Back',handler: () => {console.log('Go Back');}},{text: 'Agree',handler: () => {
console.log('Your Account Created Successfully:'+ user.value);
this.users.add(user.value);
//var User : users = new users(user.value,password.value);
//users.push(User);
let success = Alert.create({title: 'Your Account Created Successfully',subTitle: 'Enjoy Socias!',
buttons: [{ text: 'Thank You!', handler: () => { this.nav.push(socias);}}]
});
this.nav.present(success);
}}]});
示例6: addMessage
addMessage(el){
let newMessage = {text: el.value};
this.messages.add(newMessage);
el.value = '';
}
示例7: addQuestion
addQuestion(newQuestion:any){
this.questions.add(newQuestion);
}
示例8: join
join(task : HTMLInputElement): void {
console.log(`Adding user to users in chat room: ${task.value} `);
this.users.add(task.value);
}