Element: <oj-bind-if>

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

Attributes

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Version:
  • 5.0.0
Since:
  • 4.1.0
Module:
  • ojknockout

If Binding

Use <oj-bind-if> to conditionally render its contents only if a provided test returns true. Note that the <oj-bind-if> element will be removed from the DOM after binding is applied. For slotting, applications need to wrap the oj-bind-if element inside another HTML element (e.g. <span>) with the slot attribute. The oj-bind-if element does not support the slot attribute.

Example

Initialize the oj-bind-if:

<oj-bind-if test='[[myTest]]'>
  <div>My Contents</div>
</oj-bind-if>

Attributes

test :boolean

The test condition for the if clause. The children of the element will only be rendered if the test is true.
Example

Initialize the oj-bind-if:

<oj-bind-if test='[[myTest]]'>
  <div>My Contents</div>
</oj-bind-if>