I want to display my database data into ionic view. here detail data in my database:
{firstName: "John", lastName: "Doe", username: "jhondoe"}
my code in page controller:
import { AngularFireDatabase, FirebaseObjectObservable } from 'angularfire2/database';
profile : FirebaseObjectObservable<Profile>;
this.afAuth.authState.subscribe(data => {
if(data.email && data.uid){
this.afDatabase.object(`profile/${data.uid}`).valueChanges().subscribe(profile => {
this.profile = profile;
console.log(profile);
});
});
view page:
<ion-content padding>
<p>Username: {{ profile?.username | async }}</p>
<p>First Name: {{ profile?.firstName | async }}</p>
<p>Last Name: {{ profile?.LastName | async }}</p>
</ion-content>
but it not work, and display error:
InvalidPipeArgument: 'John' for pipe 'AsyncPipe'