Hi guys, i have error on my ionic project which is the piping. it cannot call back the data of the user that has just updated to profile page. please help. thanks :)
Profile
My Profile
Name: {{(profileData | async)?.name}}
Matric No.: {{(profileData | async)?.matric}}
Course: {{(profileData | async)?.course}}
Gender: {{(profileData | async)?.gender}}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, App } from 'ionic-angular';
import { AngularFireDatabase, AngularFireObject } from 'angularfire2/database';
import { Profile } from './../../models/profile';
import { AngularFireAuth } from 'angularfire2/auth';
import { Observable } from 'rxjs/Observable';
Original issue by @paanazam96 on 2018-03-19T15:47:33Z
Hi guys, i have error on my ionic project which is the piping. it cannot call back the data of the user that has just updated to profile page. please help. thanks :)
My Profile
Name: {{(profileData | async)?.name}}
Matric No.: {{(profileData | async)?.matric}}
Course: {{(profileData | async)?.course}}
Gender: {{(profileData | async)?.gender}}
import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams, App } from 'ionic-angular'; import { AngularFireDatabase, AngularFireObject } from 'angularfire2/database'; import { Profile } from './../../models/profile'; import { AngularFireAuth } from 'angularfire2/auth'; import { Observable } from 'rxjs/Observable';
@IonicPage() @Component({ selector: 'page-profile', templateUrl: 'profile.html', }) export class ProfilePage {
profileData: AngularFireObject
constructor( public navCtrl: NavController, public navParams: NavParams, private app: App, private afDatabase: AngularFireDatabase, private afAuth: AngularFireAuth, ) { }
ionViewWillLoad() { this.afAuth.authState.subscribe(data => { if (data && data.email && data.uid) { this.profileData = this.afDatabase.object(
profile/${data.uid}
); } }); }logout() { //Api Token this.app.getRootNav().setRoot('WelcomePage'); }
createevent() { this.navCtrl.setRoot('CreatePage'); }
update(){ this.navCtrl.push('UpdatePage'); }
}
Ionic Framework: 3.9.2 Ionic App Scripts: 3.1.8 Angular Core: 5.0.3 Angular Compiler CLI: 5.0.3 Node: 6.11.4 OS Platform: Windows 10