ExponentialWorks
Frontend {menu:} Related {menu:} Controller's Manifest{menu:} Interacting with the front-end{menu:} EXC | DEV | Documentation


App Controller

The app controller is responsible for the orchestration of your app's entire life-cycle and every application must have an app controller.

The app controller is actually the only controller required in an EXC app, yet as your app grows in complexity we can add other controllers to better structure our app logic, made the code more manageable and add reusability.

EXC uses a global object named app as your app controller. When EXC is loading it will wait until a variable named app appears on the global scope (In a browser thats the window or self).

The app object can be inline inside your HTML in a <script> tag or loaded dynamically.

<html>
<head>...</head>
<body>
...
<script type='text/javascript'>
app = {
	initialize: function(){
		//app object was loaded as the app controller
	}
};
</script>
</body>
</html>


Fork me on GitHub