How To Make The Custom Key While Pushing In The Angular 2 Firebase Database
My app.component.ts is as follows import { Component } from '@angular/core'; import { AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2/dat
Solution 1:
In order to create your own key, you shouldn't use the push()
method.
You can use the set()
or update()
method to create a new user at specific database index, for example:
this.db.object('users/YOUR_ID').set({
name: 'Aswin',
city:'kochi',
bedrooms:'rarish@gmail.com',
image:'9562096886',
path:'10',
price:'java',
title:'3',
type:'adipoli aanu'
});
Post a Comment for "How To Make The Custom Key While Pushing In The Angular 2 Firebase Database"