Skip to content

Instantly share code, notes, and snippets.

@davismj
Forked from AshleyGrant/app.html
Last active May 17, 2020
Embed
What would you like to do?
Activation and Children Order
<template>
<svg element.ref="svg">
<polyline element.ref="polyline"></polyline>
</svg>
<pre>&lt;polyline points="${pointsAttribute}"&gt;</pre>
<button click.trigger="addPoints()">Add points</button>
</template>
export class App {
svg: SVGSVGElement;
polyline: SVGPolylineElement;
addPoints() {
for (let i = 0; i < 10; i++) {
let point: SVGPoint = this.svg.createSVGPoint();
point.x = point.y = i;
this.polyline.points.appendItem(point)
}
}
get pointsAttribute(): string {
return this.polyline.getAttribute('points');
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body aurelia-app>
<h1>Loading...</h1>
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script>
<script>
require(['aurelia-bootstrapper']);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment