Render SVG string as actual icon instead of text in VisualNEO Web AngularJS bindings - Forum

Forum Navigation
You need to log in to create posts and topics.

Render SVG string as actual icon instead of text in VisualNEO Web AngularJS bindings

In VisualNEO Web, normally, variables render correctly with square brackets:

<span>[user.name]</span>
<span>[myArray.length]</span>

But when I store an SVG string like this:
BEGINJS
$App.file = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-plus"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="12" y1="18" x2="12" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></svg>';

ENDJS
and use in html: [file]

it only displays the SVG code as text instead of rendering the SVG icon.

What is the best way to render the SVG directly inside HTML in VisualNEO Web?

Is there an official/recommended method using AngularJS, ng-bind-html, or another approach?

 

@asmat
изучите один из моих проектов в нем я применяю svg для кнопок
Check out one of my projects where I use SVG for buttons.

luishp and asmat have reacted to this post.
luishpasmat