title: how to create user profile in ionic with firebase
body: <p>I am new to Ionic and Angular. I am developing an order placement app, but I m having trouble with creating a new user profile. </p>
  
  <p>I m following this <a href="https://www.youtube.com/watch?v=uESqBwFVf1Q&amp;t=307s" rel="nofollow noreferrer">video</a>, but data is not saving in Firebase. Also, I already have a list in firebase with name orders.</p>
  
  <p><strong>profile.ts</strong></p>
  
  <pre><code>import { Component } from '@angular/core';
  import { IonicPage, NavController, NavParams } from 'ionic-angular';
  import { Profiles } from "../../models/profile/profile";
  import { AngularFireAuth } from 'angularfire2/auth';
  import { AngularFireDatabase } from 'angularfire2/database';
  import { LoginPage } from '../login/login';
  
  
  @IonicPage()
  @Component({
    selector: 'page-profile',
    templateUrl: 'profile.html',
  })
  export class ProfilePage {
  
    profile = {} as Profiles
    // ref:any;
  
    constructor(private afAuth: AngularFireAuth, private afDatabase: AngularFireDatabase, public navCtrl: NavController, public navParams: NavParams) {
      // this.ref = afDatabase.list("Profile");
    }
  
    createProfile(){
      const user = this.afAuth.authState.take(1).subscribe(auth =&gt; {
        this.afDatabase.object(`Profiles/${auth.uid}`).set(this.profile)
        .then(() =&gt; {
          // this.navCtrl.setRoot(LoginPage)
  
        });
        console.log(user);
      })
     }
  }
  </code></pre>
  
  <p><strong>models/profile/profile.ts</strong></p>
  
  <pre><code>export interface Profiles {
      firstName: string;
      lastName: string;
      eventName: string;
      hall: string;
      booth: string;
  
  }
  </code></pre>
  
  <p><strong>profile.html</strong></p>
  
  <pre><code>&lt;ion-header&gt;
    &lt;ion-navbar color="primary"&gt;
      &lt;ion-title&gt; Create Profile&lt;/ion-title&gt;
    &lt;/ion-navbar&gt;
  &lt;/ion-header&gt;
  
  &lt;ion-content padding&gt;
    &lt;ion-list&gt;
      &lt;ion-item&gt;
        &lt;ion-label floating [(ngModel)]="profile.firstName" ngDefaultControl&gt;First Name&lt;/ion-label&gt;
        &lt;ion-input type="text"&gt;&lt;/ion-input&gt;
      &lt;/ion-item&gt;
      &lt;ion-item&gt;
        &lt;ion-label floating [(ngModel)]="profile.lastName" ngDefaultControl&gt;Last Name&lt;/ion-label&gt;
        &lt;ion-input type="text"&gt;&lt;/ion-input&gt;
      &lt;/ion-item&gt;
      &lt;ion-item&gt;
        &lt;ion-label floating [(ngModel)]="profile.eventName" ngDefaultControl&gt;Event Name&lt;/ion-label&gt;
        &lt;ion-input type="text"&gt;&lt;/ion-input&gt;
      &lt;/ion-item&gt;
      &lt;ion-item&gt;
        &lt;ion-label floating [(ngModel)]="profile.hall" ngDefaultControl&gt;Hall #&lt;/ion-label&gt;
        &lt;ion-input type="text"&gt;&lt;/ion-input&gt;
      &lt;/ion-item&gt;
      &lt;ion-item&gt;
        &lt;ion-label floating [(ngModel)]="profile.booth" ngDefaultControl&gt;Booth #&lt;/ion-label&gt;
        &lt;ion-input type="text"&gt;&lt;/ion-input&gt;
      &lt;/ion-item&gt;
    &lt;/ion-list&gt;
    &lt;button ion-button block (click)="createProfile(Profiles)"&gt;Create Profile&lt;/button&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wYWUd.png" rel="nofollow noreferrer">This what i m getting on console after submitting</a></p>
  
  <p>One more thing in last i have also integrated firebase login system with my app which is not logging out so, not sure if its creating a problem.</p>
  
  <p>Plz guide me where i am doing wrong?</p>