I have the following which simply pushes a name into the database along with a uid. I would like to store that uid in another location at the same time. How can I achieve this? Im using ionic 3, angularfire2.
addName() {
      let prompt = this.alertCtrl.create({
        title: 'Name of user',
        message: "Enter a name for this new user",
        inputs: [
          {
            name: 'Name',
            placeholder: 'Username'
          },
        ],
        buttons: [
          {
            text: 'Cancel',
            handler: data => {
              console.log('Cancel clicked');
            }
          },
          {
            text: 'Save',
            handler: data => {
              this.users.push({
                title: data.Name,
              });
              this.posts.push({
                title: data.Name
              });
            }
          }
        ]
      });
      prompt.present();
    } 
Thanks in advance
Source: AngularJS
from Angular Questions https://angularquestions.com/2017/10/10/push-firebase-uid-to-multiple-locations-angularfire2-ionic-3/
via @lzomedia #developer #freelance #web #lzomedia.com
No comments:
Post a Comment