AngularJs if statement in ng-href
I have some elements that are dynamically created and each element has a different ng-href.
I want to give different links according to some elements.
When I try to write a function in ng-href, it sends the page to work in url, so it doesn't work.
I am trying to do something like this:
.......
<a
ng-href='if(m){#linkOne} else {#linkTwo}'
ng-click='test(type);'>
</a>
.......
Which method should I use to create an element with different ng-href?
+3
source to share
4 answers