I am looking for the Typescript syntax to hide or show an Image component when a Button is clicked. I see some examples but not for Ionic 4 Typescript.
I am looking for the Typescript syntax to hide or show an Image component when a Button is clicked. I see some examples but not for Ionic 4 Typescript.
I would like some good example of this as well. I have been focusing on some other things in my app, but will be pivoting back this eventually.
Hello,
It is pretty simple to do with *ngIf directive on any component you want to hide: https://angular.io/api/common/NgIf
The ngIf works well. But I am struggling to get it to show/hide indiviual ListItems.
On my ListItem I have this:
*ngFor: let task of taskList
*ngIf: true
That does not work. I was hoping it would show all list items. In fact the app shows nothing when Tested.
Ultimately I want to show/hide list items based on an underlying value. So for example on each task:
*ngIf: task.taskName == 'abc'
Hello,
You are right, the combination of ngFor and ngIf doesn't work there. Please see possible solutions here: https://stackoverflow.com/questions/346 ... sing-error
Thanks for the link. I had already worked around it by doing all the *ngIf work in the background and then bound my list to a temp array which just contained the list items I wanted to show. Messy but workable
Thank you for this update! Glad it works now!