{{#liquid-if}}
is a replacement for Ember's
normal
{{#if}}
, except it:
true
and
false
states.
<LiquidUnless> </LiquidUnless>
is the complement to
{{#liquid-if}}
.
Here's a bit of a silly example that shows off the flexibility of the transition rules.
<div id="liquid-box-demo">
<label>
I'm renting a
</label>
<SimpleSelect @value= @choices= @onChange= />
<label>
Would you like a helmet?
<Input @type="checkbox" @checked="helmet" />
</label>
<label>
License Number
</label>
<Input @type="text" @value= />
<label>
License State
</label>
<SimpleSelect @value= @choices= @onChange= />
<button type="button" class="btn btn-light">
Yay, let's go!
</button>
</div>
this.transition(
this.hasClass('vehicles'),
// this makes our rule apply when the liquid-if transitions to the
// true state.
this.toValue(true),
this.use('crossFade', { duration }),
// which means we can also apply a reverse rule for transitions to
// the false state.
this.reverse('toLeft', { duration }),
);