{ "id": "guide/svg-in-templates", "title": "SVG as templates", "contents": "\n\n\n
You can use SVG files as templates in your Angular applications. When you use an SVG as the template, you are able to use directives and bindings just like with HTML templates. With these features, you can dynamically generate interactive graphics.
\nSee the
The following example shows the syntax for using an SVG as a template.
\nTo see property and event binding in action, add the following code to your svg.component.svg
file:
The example given uses a click()
event binding and the property binding syntax\n([attr.fill]=\"fillColor\"
).