Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Disable buttons inside side menu in ionic

$
0
0

What if I want to disable a button based on a condition inside the side menu? The condition needed to check will be available only after I login to the application. In the app.component.ts I’m defining my pages like

this.pages = [
 {
   title: "a",
   component: aPage,
   src: "..",
 }, ......, {}
]

And in my app.html I’m using ngFor inside a button to loop through the pages to display like

<ion-menu [content]="content side="right persistent="true" (ionOpen)="openMenu()">
 <ion-header>
 ......
 </ion-header>
 <ion-content>
  <ion-list>  
  <button 
      id="{{p.title}} 
      menuClose 
      ion-item 
     *ngFor="let p of pages"
     (click)="openPage(p)"
   ><span>{{p.title}}</span></button>
  </ion-list>
 </ion-content>
</ion-menu>

I want to disable a button based on a condition hot to do that ?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>