ludo.ObjectFactory

ludo.


new ludo.ObjectFactory()

Internal class designed to create ludoJS class instances.

Use ludo.factory to reference this class.

Source:

Methods


create(config) → {ludo.Core}

Creates an instance of a class by "type" attribute

Parameters:
Name Type Description
config Object | ludo.Core
Source:
Returns:

object

Type
ludo.Core

createAlias(typeName, classReference)

Creates alias name to a custom View or class for use in the type attributes.

Parameters:
Name Type Description
typeName String
classReference ludo.Core
Source:
Example
ludo.factory.ns('MyApp.view'); // creates window.MyApp.view if undefined

	 // Create new class
	 MyApp.view.MyView = new Class({
	 		Extends: ludo.View
	 });

	 // Create alias name "MyView" which refers to MyApp.view.MyView
	 ludo.factory.createAlias('MyView', MyApp.view.MyView);
	 ...
	 ...
	 new ludo.View({
	 		...
	 		children:[{
	 			type:'MyView' // Alias name used instead of full namespace and class name
			}]
		});