Reputation: 245
I want to dynamically generate image url in ng-reapeat like this
<img ng-src="{{baseurl}}+{{category.imageurl}}">
the above code is not working. Please help me how can I do it.
Upvotes: 1
Views: 1652
Reputation: 500
Depending on which version of AngularJS you are using, this is expected.
Check this out:
https://docs.angularjs.org/guide/migration#you-can-only-bind-one-expression-to-src-ng-src-or-action-
Upvotes: 0
Reputation: 691755
If the +
is out of the mustaches, it's not interpretedt at all and ends up being in the attribute value. You just need
{{baseurl}}{{category.imageurl}}
or, better,
{{baseurl + category.imageurl}}
Upvotes: 4