1

Is it possible to compose a template defined in the same file, like the following. Or is it required that the composed template be contained in a separate file?

<template>
    <template name=myTemplate" bindable="instance">
        $(instance.someText}
    </template>

    <div with.bind="instance">
        <compose view="myTemplate" model="instance"/>
    </div>
</template>
Doug Kent
  • 865
  • 2
  • 9
  • 20
  • http://stackoverflow.com/questions/36191678/aurelia-inline-definition-of-html-only-custom-element – Jeremy Danyow Oct 03 '16 at 14:56
  • @JeremyDanyow that only seems to be possible when you use SystemJS. Is there any way to make it work with aurelia-cli? – Fred Kleuver Oct 03 '16 at 15:19
  • @JeremyDanyow It seems that solution only works if one includes the associated javascript. Am I correct? I'm not interested in using that solution, as it looks too fragile. I would much rather see a solution that is built into Aurelia. – Doug Kent Oct 03 '16 at 16:59
  • @FredKleuver yes, the system.register would change to something like require.define – Jeremy Danyow Oct 03 '16 at 17:02
  • @DougKent correct, understandable- remaining options are: use separate files or request enhancement (or even better... send PR) – Jeremy Danyow Oct 03 '16 at 17:03
  • @JeremyDanyow Enhancement is already requested, [here](https://github.com/aurelia/templating/issues/473) :-) – Doug Kent Oct 03 '16 at 22:12

0 Answers0