Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.
Nick Busey edited this page Apr 14, 2014 · 13 revisions

How do I add a JavaScript / CSS Library?

Find it on Bower and then run bower install --save thing_you_found. Done. Modify the load order in config.coffee if necessary.

What if it's not in Bower?

You need something that's not on Bower? Sounds dubious. Put it in vendor/scripts or vendor/styles and then modify config.coffee to control the load order.

How do I add Bootstrap?

bower install --save bootstrap

How do I Detect the Environment?

In a template you can access {{env.isDevelopment}}, {{env.isProduction}}, and {{env.name}.

In code you need to Environment = require 'config/environment' and then instantiate the object env = Environment.create(). After that, you can access env.get('isProduction') and so on.

How do I set Ember Feature Flags?

Enabling feature flags in Ember requires setting an ENV variable before Ember loads. There's already a blank vendor/ember/config/before.coffee file that's being loaded before Ember. You must be running the Canary or Beta build of Ember for feature flags to work. Install it via cake -c "canary" ember:install. Read more on emberjs.com.

How do I use Bower?

All you need to do is run bower install --save package. E.g. bower install --save moment, and now you've got Moment.js in your vendor.js.