Just updating this in case anyone else is looking for a solution to a
similar problem ... I don't know if this is the "right" way but it works
for me:
Instead of:
...xlink:href="#icon-{{ thing.icon }}"...
I had to use:
...xlink:href="{{ getIcon(thing.icon) }}"...
And then define a function in the controller like:
$scope.getIcon = function(i) { return '#icon-' + i; }
Again, not saying this is the best way ... :)
On Monday, February 6, 2017 at 3:24:52 AM UTC-5, Darren Hewer wrote:
>
> Hi, I'm a newbie to Angular (1.6.1), please be patient. :) I'm trying to
> do something like this (simplified example):
>
>
> <li ng-repeat='thing in list'>
> <svg class="icon" aria-hidden="true"><use xlink:href="#icon-{{ thing.icon
> }}"></use></svg>
> </li>
>
>
> Basically I want to determine which SVG sprite to use based on the value
> of "thing.icon".
>
>
> But Angular gives me "Error: [$interpolate:noconcat]", which it says is a
> security protection against XSS:
> https://docs.angularjs.org/error/$interpolate/noconcat
>
>
> Any thoughts on how to avoid this, and/or better approaches? Thanks!
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.