Ionic list - mark as fav

Hi guys, I’m new to ionic … do you know how to fav list items?

Use case:
I have a list and there is a ‘grey star’ on each item
I tap on it and it turns to color
This is persisted on refresh

Thanks, cheers

store the favs in your backend?

or use mysql plugin (or another clientside db) or write a json file and store those values.

Simply you could use localstorage, but that not as persistent as you want --> it gets wiped away in some cases.

1 Like

Right thanks … I was more wondering if this is actually possible with Ionic … I have an ion-list with ion-items … these item link to detail views … so they are clickable … what I want to implement is a ‘grey star’ for inactive fav and then when you tap it, it turns to ‘black star’ for active (and possibly this is stored to localStorage for persistency) … however now, wherever I click/tap within that item it leads to the next view … how can I select/interact with only the star? @brandyshea - any insights? Thanks!

addition: so far I only solved it with ion-option-button so you need to swipe to the left to reveal it, tap it and then the star appears …

OK, i achieved what I wanted with onclick=“return false” and it still retains the functionality so I assume this is how to do this …