Element: <oj-bind-if>

Oracle® JavaScript Extension Toolkit (JET)
9.2.0

F30740-01

Signature:

class ojBindIf

QuickNav

Attributes

Version:
  • 9.2.0
Since:
  • 4.1.0
Module:
  • ojknockout

Module usage

See JET Module Loading for an overview of module usage within JET.

Typescript Import Format
//To typecheck the element APIs, import as below.
import {ojBindIf} from "ojs/ojknockout";

//For the transpiled javascript to load the element's module, import as below
import "ojs/ojknockout";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

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.

Slots

JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.

Default

The oj-bind-if default slot is used to specify content that will be rendered when the test condition evaluates to true.

Attributes

test :boolean

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