Reputation: 21
Currently 2 windows, my login, and my home, my menu is in app.html, in this menu, I have the user's name an interpolation {{user}}
.
But this user is loaded when he enters the login, that is to say, that when he just logs me in, he brings me the name and interpolates it, I do not know how to achieve that if I can help
For example, this interpolation gives Ivan value, when it is in the home, but does not reflect the changes in the menu
app.html:
<ion-menu [content]="mycontent">
<ion-content>
<ion-list>
<p>{{ usuario }}</p>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav #mycontent [root]="rootPage"></ion-nav>
home.html:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { MenuController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
usuario: string = "Ivan"
constructor(public navCtrl: NavController, public menuCtrl: MenuController) {
this.menuCtrl.enable(true);
}
}
Upvotes: 0
Views: 1385
Reputation: 2872
you are putting this code:
<ion-menu [content]="mycontent">
<ion-content>
<ion-list>
<p>{{ usuario }}</p>
</ion-list>
</ion-content>
</ion-menu>
in the wrong file. Put it in home.html
. The way ionic
works is, when you load home.html
by going to your home
page, the app loads the home
page in rootPage
in app.html
. You don't actually put any code in app.html
.
Upvotes: 1