with.bind (scope binding)
Change the binding context for a section of a template using Aurelia's built-in with template controller.
Basic usage
<template with.bind="user">
<h2>${firstName} ${lastName}</h2>
<p>${email}</p>
</template><section with.bind="user">
<h2>${firstName} ${lastName}</h2>
</section>“Shape” a small context object
<template with.bind="{ profile: user.profile, canEdit: permissions.admin }">
<user-profile profile.bind="profile"></user-profile>
<button disabled.bind="!canEdit">Edit</button>
</template>Updates and lifecycle
Gotchas
Last updated
Was this helpful?