Ionic option button directive not working on first click

In my list items, I am using an ionic option button with an icon that toggles on and off via a directive. The issue is that after I slide to review the option button, it takes two clicks to initially toggle the heart icon from off to on. How can I make it so that it will toggle on the first click? Please help.


the directive does that what you have implemented… look closely:

var currentState = true;
if(currentState === true) {

First time --> you remove the onIcon and add the classe offIcon, because currentState is true after you initialization :wink: