Sometimes I need a part of html to show in multiple location on a single page/view.
Anyone know of any easy solution to have a reference to a html part in a view, and slot it into multiple different locations in that same view? Like a custom-element(html-only), but defined at top of the view, and only usable in the current view.
<div>
I want to take this part, defined in top of view
with this ${variable}
and this <button click.delegate="method()">BUTTON</button>
</div>
...
<div> and copy/reference it here </div>
...
<div> and here </div>
...
<div> and maybe here </div>
Like a html version with binding of the ‘let’ custom element:
<let do-something-btns.bind>
<button click.delegate="doSomething()"></button>
<button click.delegate="doSomethingElse()"></button>
</let>
<div class="somewhere-top-of-view">
<template innerhtml.bind="doSomethingBtns"></template>
</div>
<div class="somewhere-bottom-of-view">
<template innerhtml.bind="doSomethingBtns"></template>
</div>