Can i check storage in app.component.ts file for menu showing


#1

app.component.ts

this.storage.get('id').then((id) => {
				  
		this.resp = user_id;
	})

this.pages = [
		{ title: 'Home', component: HomePage },
		{ title: 'Logout', component: Logout }
    ];

html

<ion-list  [hidden]="!resp">
      <button menuClose ion-item  *ngFor="let q of pages " (click)="openPage(q)">
        {{q.title}}
      </button>
    </ion-list>

when id is null then ion-list will be hidden. Thanks in advanced.


#2

And what is your question?
Does this code work?
Doesn’t it work? Are you expecting something else than what happens?


#3

Actually i want to show menu if id is not null. but when id is null then ion-list is showen.


#4

I’m confused. The menu is inside the <ion-list>, so how can they be displayed under mutually exclusive conditions?