Class Ember.ContainerDebugAdapter
publicThe ContainerDebugAdapter
helps the container and resolver interface
with tools that debug Ember such as the
Ember Extension
for Chrome and Firefox.
This class can be extended by a custom resolver implementer to override some of the methods with library-specific code.
The methods likely to be overridden are:
canCatalogEntriesByType
catalogEntriesByType
The adapter will need to be registered
in the application's container as container-debug-adapter:main
Example:
Application.initializer({
name: "containerDebugAdapter",
initialize: function(container, application) {
application.register('container-debug-adapter:main', require('app/container-debug-adapter'));
}
});
concatenatedProperties public
Inherited from Ember.CoreObject packages/ember-runtime/lib/system/core_object.js:273
Defines the properties that will be concatenated from the superclass (instead of overridden).
By default, when you extend an Ember class a property defined in
the subclass overrides a property with the same name that is defined
in the superclass. However, there are some cases where it is preferable
to build up a property's value by combining the superclass' property
value with the subclass' value. An example of this in use within Ember
is the classNames
property of Ember.View
.
Here is some sample code showing the difference between a concatenated property and a normal one:
App.BarView = Ember.View.extend({
someNonConcatenatedProperty: ['bar'],
classNames: ['bar']
});
App.FooBarView = App.BarView.extend({
someNonConcatenatedProperty: ['foo'],
classNames: ['foo']
});
var fooBarView = App.FooBarView.create();
fooBarView.get('someNonConcatenatedProperty'); // ['foo']
fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']
This behavior extends to object creation as well. Continuing the above example:
var view = App.FooBarView.create({
someNonConcatenatedProperty: ['baz'],
classNames: ['baz']
})
view.get('someNonConcatenatedProperty'); // ['baz']
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
Adding a single property that is not an array will just add it in the array:
var view = App.FooBarView.create({
classNames: 'baz'
})
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
Using the concatenatedProperties
property, we can tell Ember to mix the
content of the properties.
In Ember.View
the classNameBindings
and attributeBindings
properties
are also concatenated, in addition to classNames
.
This feature is available for you to use throughout the Ember object model, although typical app developers are likely to use it infrequently. Since it changes expectations about behavior of properties, you should properly document its usage in each individual concatenated property (to not mislead your users to think they can override the property in a subclass).
container public
Defined in packages/ember-extension-support/lib/container_debug_adapter.js:52
The container of the application being debugged. This property will be injected on creation.
isDestroyed public
Inherited from Ember.CoreObject packages/ember-runtime/lib/system/core_object.js:342
Destroyed object property flag.
if this property is true
the observers and bindings were already
removed by the effect of calling the destroy()
method.
isDestroying public
Inherited from Ember.CoreObject packages/ember-runtime/lib/system/core_object.js:354
Destruction scheduled flag. The destroy()
method has been called.
The object stays intact until the end of the run loop at which point
the isDestroyed
flag is set.
resolver public
Defined in packages/ember-extension-support/lib/container_debug_adapter.js:63
The resolver instance of the application being debugged. This property will be injected on creation.