ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
127 stars 85 forks source link

InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' at invalidPipeArgumentError #455

Open ionitron-bot[bot] opened 5 years ago

ionitron-bot[bot] commented 5 years ago

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 :)

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';

@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

TFGhub commented 5 years ago

hello did you find solution to your problem .I also have the same problem

jbiddulph commented 5 years ago

Did you get this sorted? I too am having the error!

MarwenHanzouli commented 4 years ago

Any solution for this ? I also have the same problem