SVG

A developer guide for enabling SVG binding in the Aurelia.

Learn about enabling SVG binding in Aurelia template.

Adding SVG registration

By default, Aurelia won't work with SVG elements, since SVG elements and their attributes require different parsing rules. To teach Aurelia how to handle SVG element bindings, add the SVGAnalyzer like the following example:

import { SVGAnalyzer } from '@aurelia/runtime-html';
import { Aurelia } from 'aurelia';

Aurelia
    .register(SVGAnalyzer) // <-- add this line
    ...

After adding this registration, bindings with attributes will work as expected and the syntax is the same with the other bindings. Readmore on the basic binding syntax of Aurelia here.

Last updated

Was this helpful?

Revision created

refactor(event): no longer call prevent default by default (#1926) BREAKING CHANGE: no longer calling preventDefault on all events, this can be switched back to v1 behavior via IListenerBindingOptions [skip ci] * BREAKING CHANGE: no longer reexport fetch plugin from aurelia package * fix(router-lite): dont register config * chore: cleanup unused methods, correct typings on test fixture