angular - I want to get child key of object in angular2 -


inside of education_qualification object random key generated want key, how possible ? have tried update key got education_qualification not inside key.

create(model, bankdetails, currentaddress, permanentaddress, education) { const obj = this.employees.push(model); obj.update({     id: obj.key,     bank_details: bankdetails,     current_address: currentaddress,     permanent_address: permanentaddress, },     (error) => {         const edu = obj.child('/education_qualification/');         (let = 0; <= education.length; i++) {             edu.push(education[i]);              edu.update({                     id: edu.key,             });         }     }); } 

i want key inside of education_qualification

push returns database reference.

firebase push documentation

this means key following:

create(model, bankdetails, currentaddress, permanentaddress, education) { const obj = this.employees.push(model); obj.update({     id: obj.getkey(),     bank_details: bankdetails,     current_address: currentaddress,     permanent_address: permanentaddress, },     (error) => {         const edu = obj.child('/education_qualification/');         (let = 0; <= education.length; i++) {             edu.push(education[i]);              edu.update({                     id: edu.key,             });         }     }); } 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -