EMBER WORKSHOP: Ember Application

Ember Application Basics

by jdcravens

HTML

<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://builds.emberjs.com/release/ember.js"></script>

JavaScript

// App is the namespace
// Adds event listeners to the document and is responsible for delegating events to your views
// Active Generation of the application template.
// Active Generation of the Router, ApplicationRoute, ApplicationController

App = Ember.Application.create({
    LOG_TRANSITIONS: true,
    //LOG_RESOLVER: true,
    //LOG_ACTIVE_GENERATION: true, // log whats being actively generated
    //LOG_MODULE_RESOLVER: true, 
    //LOG_TRANSITIONS: true,
    //LOG_TRANSITIONS_INTERNAL: true,
    //LOG_VIEW_LOOKUPS: true 
});
    
// From within a Route
//this.controllerFor("application").get("currentRouteName");
//this.controllerFor("application").get("currentPath");

// From within a controller, after specifying `needs: ['application']`
//this.get('controllers.application.currentRouteName');
//this.get('controllers.application.currentPath');

// From the console:
//App.__container__.lookup("controller:application").get("currentRouteName")
//App.__container__.lookup("controller:application").get("currentPath")