-
Notifications
You must be signed in to change notification settings - Fork 4
Description
from gitter chat
decide what use cases
and wrap it up in a small guide.
to not repeat yourself and give a link
Michael Prescott @michaelprescott 18:42
In my template, I've a variety of elements that are conditionally included with if.bind's. I've a new condition now that is very lengthy, yet makes sense to include in the template. Instead of revising all the other elements' if.bind's, I wonder if I can wrap them in a non-renderable element and have a single if.bind on that element. Regardless of how it resolves, I never want the container element to be in the DOM, I just want to use it as a tool for deciding which sub elements to include. Is this a sensible approach and how do I tell aurelia not to include that element?
Michael Bull @michaelbull 18:53
use tags @michaelprescott
you can wrap all of your inner elements with an outer template tag
and do the if on it
e.g.
hello
worldexample
Michael Prescott @michaelprescott 19:04
oh, thanks! I didn't think of using within a for a custom element. Kinda makes sense now that you say it though.