Caplin Trader 5.1.0

Class: module:ct-menu/model/MenuFactory

module:ct-menu/model/MenuFactory()

new module:ct-menu/model/MenuFactory()

This class allows the user to create a model from a configuration map. Example: { alias:'caplin.anAlias', options: { label: 'a Label', otherOption: 'something' }, items: [ { alias:'caplinx.myAlias', }, { options: { label: 'another label' } } ] }

The table below explains each possible option to represent a Model.

name default type description
alias String The alias for the model to create. This parameter is optional, either a Item or a Menu will be created in case an alias is not provided.
options Map The options which will be passed to the model that is created. This parameter is optional.
items array An array of Model configuration map representations. This parameter is optional.

Methods

(static) create(config) → {module:ct-menu/Model}

Returns an instance of a module:ct-menu/Model represented configuration map passed as a parameter.

Parameters:
Name Type Description
config Map

Map to recreate the model from.

Throws:
Returns:
Type
module:ct-menu/Model