Skip to content

Commit

Permalink
Use config/environments.js to control options to provide to the appli…
Browse files Browse the repository at this point in the history
…cation.
  • Loading branch information
rwjblue committed Apr 15, 2014
1 parent bd4600a commit bb9842e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* locks it to version `0.2.0`
* Fix issue where app.js files are appended to tests.js ([#347](https://github.com/stefanpenner/ember-cli/pull/347))
* upgrade broccoli to `0.9.0` [v0.9.0 brocfile changes](https://gist.github.com/joliss/15630762fa0f43976418)
* Use configuration from `config/environments.js` to pass options to `Ember.Application.create`. ([#370](https://github.com/stefanpenner/ember-cli/pull/370))

### 0.0.23

Expand Down
5 changes: 0 additions & 5 deletions blueprint/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import loadInitializers from 'ember/load-initializers';
Ember.MODEL_FACTORY_INJECTIONS = true;

var App = Ember.Application.extend({
LOG_ACTIVE_GENERATION: true,
LOG_MODULE_RESOLVER: true,
// LOG_TRANSITIONS: true,
// LOG_TRANSITIONS_INTERNAL: true,
LOG_VIEW_LOOKUPS: true,
modulePrefix: '<%= modulePrefix %>', // TODO: loaded via config
Resolver: Resolver
});
Expand Down
2 changes: 1 addition & 1 deletion blueprint/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<script>
window.<%= namespace %> = require('<%= modulePrefix %>/app')['default'].create();
window.<%= namespace %> = require('<%= modulePrefix %>/app')['default'].create(ENV.APP);
</script>
</body>
</html>
12 changes: 11 additions & 1 deletion blueprint/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@ module.exports = function(environment) {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
},

APP: {
// Here you can pass flags/options to your application instance
// when it is created
}
};

if (environment === 'development') {

ENV.APP.LOG_RESOLVER = true;
ENV.APP.LOG_ACTIVE_GENERATION = true;
ENV.APP.LOG_MODULE_RESOLVER = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
ENV.APP.LOG_VIEW_LOOKUPS = true;
}

if (environment === 'production') {
Expand Down

1 comment on commit bb9842e

@jbrown
Copy link
Contributor

@jbrown jbrown commented on bb9842e Apr 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.