How to inspect Ember.js objects in the console?

后端 未结 4 902
面向向阳花
面向向阳花 2021-02-03 10:01

Is there any way to get at what an Ember.js object really contains in the JavaScript console. If you do console.log(this), you will get almost the same data structu

4条回答
  •  温柔的废话
    2021-02-03 10:47

    There is also the App.__container__ object which, if you know what name your objects are registered to the ember app with, will allow you to grab any object you need while debugging from any environment.

    A couple of examples are

    App.__container__.lookup('store:main') # Gets the store
    App.__container__.lookup('controller:blog') # Gets the blog controller
    

提交回复
热议问题