本文整理汇总了TypeScript中angularfire2.FirebaseListObservable.push方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseListObservable.push方法的具体用法?TypeScript FirebaseListObservable.push怎么用?TypeScript FirebaseListObservable.push使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angularfire2.FirebaseListObservable
的用法示例。
在下文中一共展示了FirebaseListObservable.push方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: new
new(item: T): any {
let result = this.firebaseList.push(item);
console.log(result);
result.then(success => console.log("successfully added new item to " + this.endpoint, success), failure => console.log("failure", failure));
return result;
}
示例2: sendMessage
sendMessage(message:string) {
this.messages$.push({
author: this.identity.name,
body: message
});
this.message = '';
}
示例3: create
create(userId:string,title: string, description: string,isPublic:boolean,photos:any): void {
this.db.push({userId,
title,
description,isPublic,photos
});
}
示例4: createVehicle
createVehicle(vehicle: IVehicle): firebase.Promise<any> {
return this.vehicles$.push(new Vehicle(
vehicle.make,
vehicle.model,
vehicle.year
));
}
示例5: addClass
addClass(className: string, classPassword: string ) {
if ( className.length < 1 ) {
this.errorMessage = this.authService.getErrorMsg('error',
{ code: 'OwnText', text: 'Názov triedy nieje vyplnený' } );
return;
}
if ( classPassword.length < 1 ) {
this.errorMessage = this.authService.getErrorMsg('error',
{ code: 'OwnText', text: 'Heslo triedy nieje vyplnené' } );
return;
}
if ( this.vyhodnotExistenciuHesla) {
return;
}
if (this.classId) {
let classData = this.angularFire.database.object('/CLASSES/' + this.classId);
classData.update({className: className, heslo: classPassword} );
this.errorMessage = this.authService.getErrorMsg('success', { code: 'OwnText', text: 'Zmeny boli úspešne zapísané' } );
setTimeout(() => {this.router.navigate(['classes']); }, 2000);
}else {
this.items.push(new Trieda ( className, classPassword, this.uId));
this.errorMessage = this.authService.getErrorMsg('success', { code: 'OwnText', text: 'Trieda bola úspešne vytvorená' } );
setTimeout(() => {this.router.navigate(['classes']); }, 2000);
}
}
示例6: send
send(text: string) {
this.messages.push({
text: text,
userName: this.userName,
avatar: this.avatar
});
}
示例7: addItem
addItem(e: Event) {
e.preventDefault();
this.items.push({
name: this.itemName
});
this.clear();
}
示例8: addStory
//stories
addStory(newTitle:string) {
this.stories.push({
title: newTitle,
status: 'active',
sections: []
});
}
示例9: new
new(item : T) : any {
let result = this.firebaseList.push(item);
console.log(result);
result.then(success => console.log("success",success), failure => console.log("failure",failure));
return result;
}
示例10: saveEvent
saveEvent(data:Array<any>) {
let promise = this._events.push(data);
return promise.then(
(res) => { return { code: "Event saved succesfully" } },
(err) => { return { code: err } }
)
}