I'm currently developing in AngularJS / Jade and I need to implement functionality where an icon changes when a user clicks on something. The code I have right now looks like this:
a(onclick='return false', href='#general', data-toggle='tab') General
span.glyphicon(ng-class='isGeneralChanged(selected) ? "glyphicon-ok-circle" : "glyphicon-adjust"')
Following that, there is the following code:
.form-group
label Has the design been entered?
toggle-switch(model='selected.general_engineer_made_inspection', on-label='Yes', off-label='No')
The issue I am facing is that changing the icon based on a simple "yes" or "no" is straightforward, but on another tab, there are only names listed. Clicking on any of these names should change the icon in the tab accordingly. I am unsure how to approach solving this. Perhaps utilizing the ng-click
event would be useful?