API Docs for: 0.0.2
Show:

controller.Controller Class

Extends Core
Module: Canvas

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:

Item Index

Properties

Properties

applyTo

Array

Apply controller to components in these modules. By default a controller will be set as controller for all component within the same namespace (name space is determined by parsing "type" attribute), Example:

You have created a Image Crop module within ludo.app.crop. You have these components there

ludo.crop.GUI ( View component with type set to "crop.GUI") ludo.crop.Coordinates (View component with type set to "crop.Coordinates") ludo.crop.Controller (Controller with type set to "crop.Controller")

The controller will in this example be set as controller for all components within the "ludo.crop" namespace.

(if useController for the component is set to true) This property is used to override the default

Default: undefined

broadcast

Object

List of events which will be automatically broadcasted,i.e. re-fired by the controller

Example:

broadcast:{
        'ns.Component' : ['eventOne',{'viewEventName':'controllerEventName}],
        'ns.ComponentTwo' : ['send','receive']
    }

In this example, the controller will listen to "eventOne" and "viewEventName" of view of "type" ns.Component and re-fire them so that other views can listen to them. The "viewEventName" will be re-fired as a "controllerEventName".