Todd Mortensen
Posts: 4
Joined: Mon Jun 15, 2020 1:15 am

Hide select menu

Hi,
I want to hide a select menu based on some value. The select item wrapper is named "selDayOfWeek". I have an event that I created to evaluate the condition of another element, but can't quite find the typescript that would disable it. The older examples I find in the forums don't seem to work with ionic 4.
I feel like I should be able to do something like this.Apperyio(selDayOfWeek).Disabled(false), but it doesn't play.
Any help would be appreciated,
Thanks

brendanm@ite.co.za
Posts: 26
Joined: Mon Jul 27, 2020 12:05 pm

Re: Hide select menu

Have you tried a *ngIf angular directive?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Re: Hide select menu

Hello,

@brendanm is right. Please define a global variable for that and use it in the *ngIf property of that menu item https://angular.io/api/common/NgIf

Todd Mortensen
Posts: 4
Joined: Mon Jun 15, 2020 1:15 am

Re: Hide select menu

Thanks this worked great. That and a youtube video got me on my way.

All I had to do was add:
*ngIf as an attribute for the selectWrapper with a value of the boolean variable that I created for the page.
Then I made a Typescript event based off another element that would toggle that boolean variable between false and true and it shows up or hides based on that value.

Actually easier then the other approach I was trying.

Thanks,

Return to “Issues”