new ludo.controller.Controller()
Base class for controllers
A controller is by default controller for all components in the same namespace where
the useController attribute is set to true. (namespace is
determined by component's "type" attribute)
You can use the "applyTo" attribute to override this default applyTo is
an array referring to the "module" and "submodule" property of components.
example:
- Source:
Examples
applyTo:["login", "register"] will set the controller as controller for all components in modules "login" and "register" When creating a new controller, you should extend this class and implement an addView method which takes component as only argument Example:
addView:function(view){ view.addEvent('someEvent', this.methodName.bind(this)); } This methods add events to the component. To let the component listen to controller events, implement the addController method for the component(it's defined in ludo.Core)
Extends
- Core