import {inject} from 'aurelia-framework'; import {customElement, bindable, noView, processContent, TargetInstruction} from 'aurelia-templating'; @customElement('my-template') @noView() @processContent((compiler, resources, element, instruction) => { let html = element.innerHTML; if (html !== '') { instruction.template = html; } element.innerHTML = ''; }) @inject(TargetInstruction) export class MyTemplate { @bindable() model; constructor(targetInstruction) { this.template = targetInstruction.elementInstruction.template; } }