Element: <oj-if>

Oracle® JavaScript Extension Toolkit (JET)
17.0.0

F92240-01

Since:
  • 17.0.0
Module:
  • ojknockout

QuickNav

Attributes


JET If Element

Use <oj-if> to conditionally render its contents only if a provided test returns true. Unlike <oj-bind-if> this element will not be removed from the DOM after bindings are applied. The element stays in the DOM and can therefore directly be used as the slot content of a custom element. The element has display:contents style applied on it to make it transparent for any css styles that a parent container wants to pass to its descendants.


Usage

Signature:

interface IfElement

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

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

For additional information visit:


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-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.