Reputation: 6188
I have the following code:
<a href ng-click='navigateTo("/blog/1000")'>
{{ blog.blogId}}
</a>
<a href ng-click='navigateTo("/blog/{{ blog.blogId}}")'>
{{ blog.blogId}}
</a>
navigateTo is a function to change $location.path() and save some data.
Both hrefs have the same html output, yet only the top one works. Why is this?
Upvotes: 0
Views: 61
Reputation: 43947
Dont use interpolation inside ngClick
:
<a href ng-click='navigateTo("/blog/"+blog.blogId)'>
Upvotes: 2