docs/Controller.html
<!DOCTYPE html>
<html>
<head>
<title>Controller.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page">
<a class="source" href="Core.html">
Core.js
</a>
<a class="source" href="EventTypes.html">
EventTypes.js
</a>
<a class="source" href="Kronicle.html">
Kronicle.js
</a>
<a class="source" href="Module.html">
Module.js
</a>
<a class="source" href="ArrayDataSource.html">
ArrayDataSource.js
</a>
<a class="source" href="Component.html">
Component.js
</a>
<a class="source" href="Controller.html">
Controller.js
</a>
<a class="source" href="DataSource.html">
DataSource.js
</a>
<a class="source" href="DataSources.html">
DataSources.js
</a>
<a class="source" href="DataSourcesEvents.html">
DataSourcesEvents.js
</a>
<a class="source" href="View.html">
View.js
</a>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>Controller.js</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
</div>
<div class="content"><div class='highlight'><pre>import {Module} from <span class="hljs-string">'../Module.js'</span>;</pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<h1 id="kronicle-controller-class">Kronicle.Controller class</h1>
<p>depends: <a href="Module.html">Kronicle.Module</a>
This class is used to handle events from users and dispatch the proper response via view and model.
The constructor takes an args object which contains the following properties:</p>
<ul>
<li>model - the data model associated with the controller.</li>
<li>view - the Kronicle View associated withe the controller.</li>
<li>name - the name of the Controller.</li>
</ul>
</div>
<div class="content"><div class='highlight'><pre>export <span class="hljs-keyword">class</span> Controller extends Module {
constructor (args = {model: {}, view: {}, name: <span class="hljs-string">''</span>}) {
<span class="hljs-keyword">this</span>.model = args.model;
<span class="hljs-keyword">this</span>.view = args.view;
<span class="hljs-keyword">this</span>.initialize = args.initialize || super.initialize;
<span class="hljs-keyword">this</span>.initialize = <span class="hljs-keyword">this</span>.initialize.bind(<span class="hljs-keyword">this</span>);
super({name: args.name + <span class="hljs-string">'Controller'</span>});
}
}</pre></div></div>
</li>
</ul>
</div>
</body>
</html>