2 different href in "ion-item ng-repeat"


#1

Hi all,

I am trying to incorporate 2 different links in ion-item. (I.E, click on one part of the table links to A and clicking another button links to B.

How do I go around doing that?

I been stuck for days and would like some assistance! Thanks!

My StackOverflow question (More explanation and code snippet): Link


#2

You could do a ng-if to specify the links with a condition.


#3

Hi @zachary545, thanks for replying. Can you do me a favor and do an example on codepen or something so I can understand it better? thanks!


#4
<ion-list>
<ion-item ng-repeat="case in cases" class ="item-text-wrap" 
href="#/tab/cases/case-detail/{{case.ID}}" ng-if="case.name='SWITCH ROOM 1'">
<table></table>
</ion-item>

<ion-item ng-repeat="case in cases" class ="item-text-wrap" 
href="#/tab/requests/{case.ID}" ng-if="case.name='SWITCH ROOM 2'">
<table></table>
</ion-item>
</ion-list>

https://docs.angularjs.org/api/ng/directive/ngIf
Note: Don’t follow this to the “T”, as i am not following exactly to your code.


#5

I answered in SO for the navigation part.