PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.
Methods
-
(static) createView(options) → {Promise}
PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.
-
Utility function for creating a view to be used in configuration object for oj-module.
Parameters:
Name Type Description optionsObject Options object used to create a view Properties
Name Type Argument Description viewPathstring The path to the view, relative to the RequireJS baseURL. The text plugin will be used for loading the view. requirefunction <optional>
An optional instance of the require() function to be used for loading the view. By default the path is relative to the baseUrl specified for the application require calls. - Since:
- 5.0.0
Returns:
A promise that resolves into an array of DOM nodes- Type
- Promise
Example
Get promise for the view
var viewPromise = moduleElementUtils.createView({'viewPath':'views/ojModule-simple/page.html'}); -
(static) createViewModel(options) → {Promise}
PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.
-
Utility function for creating a view model to be used in configuration object for oj-module.
Parameters:
Name Type Description optionsObject Options object used to create a view model Properties
Name Type Argument Description viewModelPathstring The path to the model, relative to the RequireJS baseURL. requirefunction <optional>
An optional instance of the require() function to be used for loading the view. By default the path is relative to the baseUrl specified for the application require calls. - Since:
- 5.0.0
Returns:
A promise that contains either model instance or a model constructor. When the promise is resolved into a constructor, the application is responsible for constructing the model instance before passing it to the configuration object on the oj-module.- Type
- Promise
Example
Get promise for the model
var modelPromise = moduleElementUtils.createViewModel({'viewModelPath':'viewModels/ojModule-simple/pageModel'});