I am building some links in AngularJS v1.2.16 like such:
<a ng-href="/foo/{{id}}/t/{{list[m].id}}/{{id2}}/{{otherId}}">Click here!</a>
That works great.
Now I have a query parameter query I'd like to append to the end if it exists.
I tried to do it like so:
<a ng-href="/foo/{{id}}/{{otherId}}{{ query ? '?q=' + query : "" }}">Click here!</a>
I end up with the following, because angular just renders the entire contents to the tag into the link like so:
<a href="/foo/2/4%7B%7B%7B%20query%20?%20%27?q=%27%20+%query%20:">Click here!</a>
How can I achieve what I'm trying to do?

