Skip to content

Instantly share code, notes, and snippets.

@THuRStoN
Last active August 29, 2015 13:59
Show Gist options
  • Select an option

  • Save THuRStoN/10461917 to your computer and use it in GitHub Desktop.

Select an option

Save THuRStoN/10461917 to your computer and use it in GitHub Desktop.
Inspecting in Ember Applications
// https://github.com/aexmachina/ember-debug
Em.inspect && Em.keys
App.__container__.lookup
Em.View.views[ 'ember605' ]
Em.keys(Em.TEMPLATES).forEach(function(t){console.log(t)})
App.debug.controller( 'albums' );
App.__container__.lookup( 'controller:albums' );
var initializer = {
name: 'debug',
initialize:function (container, app) {
app.debug = {
controller: function(name){
return container.lookup("controller:" + name);
},
route: function(name){
return container.lookup("route:" + name);
},
view: function(domElem){
return Em.View.views[domElem];
},
registry: container.registry.dict,
routes: Em.keys(app.Router.router.recognizer.names),
store: container.lookup("store:main"),
typeMaps: container.lookup("store:main").typeMaps,
templates: Em.keys(Ember.TEMPLATES),
inspect: Em.inspect,
observersFor: function(observedObj, key){
Em.observersFor(observedObj, key);
}
};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment