Skip to content

Instantly share code, notes, and snippets.

@timfish
Forked from jdanyow/app.html
Last active October 31, 2017 15:32
Show Gist options
  • Save timfish/7f6a82f82455b0689e9723f776858971 to your computer and use it in GitHub Desktop.
Save timfish/7f6a82f82455b0689e9723f776858971 to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<require from="./svg-rect"></require>
<svg width="100" height="100" style="background-color:lightblue">
<rect></rect>
</svg>
</template>
export class App {
}
<!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>
<template>
<require from="./svg-remove"></require>
<svg svg-remove>
<!--<rect x.bind="rect.x" y.bind="rect.y" width.bind="rect.width" height.bind="rect.height"></rect>-->
</svg>
</template>
import {bindable} from 'aurelia-framework'
export class Rect {
@bindable rect;
}
import {inject, customAttribute} from 'aurelia-framework';
@customAttribute('svg-remove')
@inject(Element)
export class SvgRemove {
constructor(element){
this.element = element;
}
attached(){
console.log(this.element.children)
this.element.children
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment