Namespace: KnockoutUtils

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav


KnockoutUtils

Version:
  • 7.1.0
Since:
  • 1.0
Module:
  • ojknockout-model

Module usage

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

Javascript Import Format
define(['ojs/ojknockout-model'], function(KnockoutUtils) {
 // Application should call API on KnockoutUtils 
})
Typescript Import Format
//This namespace exports multiple static methods or members. To import 
import * as KnockoutUtils from "ojknockout-model";

//Now you can access the methods as KnockoutUtils.methodName and so on

JET In Typescript

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

Description

Utility methods for blending Knockout observables with the data model

Methods

(static) map(m, callback, array) → {Array<KnockoutObservable<any>>|KnockoutObservableArray<any>}

Turns the attributes in a model object (or the attributes of all models in a collection object) into Knockout observables for use with components' view models.
Parameters:
Name Type Argument Description
m Object The model or collection containing the attributes to be converted to Knockout observables.
callback function(Object) <optional>
Called once per model so that a caller can add their own Knockout computed observables to the model.
array boolean <optional>
Should function return an observable array if m is an oj.Collection, vs. an array of observables?
Returns:
array of Knockout observables or an observable array
Type
Array<KnockoutObservable<any>>|KnockoutObservableArray<any>