Slide 45
Slide 45 text
config/initializers/config.js.es6
/*
This
initializer
injections
global
configuration
options
onto
object
instances,
so
they
do
not
need
to
rely
on
accessing
globals.
!
Currently
all
of
the
config
options
are
defined
in
config/environment.js,
but
this
may
change
over
time.
!
To
access
a
config
option
on,
e.g.,
a
model,
do:
!
this.config.flags.keyRequests;
//=>
false
this.config.defaultRanges
=
[
{
},
{
},
...
];
*/
export
default
{
name:
"config",
initialize:
function(container,
application)
{
container.register('config:main',
Ember.Object.extend(CONF));
!
['model',
'view',
'controller',
'route',
'component'].forEach(function(type)
{
container.injection(type,
'config',
'config:main');
});
}
};