First, you want to use the debug version of ember, not the mini version. This will give you the best information about ember in the console.
Secondly, what was very useful to me was to add debugging to all my events in my routes, views and controllers.
I have a property in my main App class called debugMode, and then a log function.
window.App = Ember.Application.create({ debugMode: false, log: function(message, location, data) { if (this.debugMode) { if (data != null) { if (typeof data === 'object') { data = Ember.inspect(data); } console.log('DEBUG: ' + this.appName + ' : ' + location + ' : ' + message); return console.log('DEBUG: ' + this.appName + ' : (continued) data: ' + data); } else { return console.log('DEBUG: ' + this.appName + ' : ' + location + ' : ' + message); } } }
The log function receives the message, location, and then optional data.
So, two examples of registration:
register function and transfer data
App.ProfileController = Ember.ObjectController.extend({ setProfile: function() { App.log("setting current user profile", 'App.ProfileController.setProfile', App.currentUser);
register controller / view / route initialization
App.EventController = Ember.ObjectController.extend({ init: function() { this._super(); App.log('initializing event controller', 'App.EventController.init'); return this.set('isLoading', false); } })
After that, you will get more information about the console to try to diagnose where this problem occurs:
DEBUG: My App Name : App.ApplicationController : application controller initializing DEBUG: My App Name : App.ApplicationRoute.setupController : setupController called DEBUG: My App Name : (continued) data: {target: <App.Router:ember249>, namespace: App, container: [object Object], _debugContainerKey: DEBUG: My App Name : App.accountController.setCurrentUser : setting applications currentUser object DEBUG: My App Name : (continued) data: {"id":3,"username":"bob","firstName":"Bob","lastName":"W","updatedAt":"2013-04-16T06:29:39.731Z"} DEBUG: My App Name : App.EventController.init : initializing event controller DEBUG: My App Name : App.EventRoute.setupController : setupController called DEBUG: My App Name : (continued) data: {target: <App.Router:ember249>, namespace: App, container: [object Object], _debugContainerKey: controller:event, _childContainers: [object Object], isLoading: false}
Finally, use debugging with
debugger;
inside views / routes / controllers
and
{{debugger}}
inside your templates
and from console or built-in use
Ember.inspect(YOUR_OBJECT);
to view information about ember.