Skip to content

Instantly share code, notes, and snippets.

@poteto
Created August 7, 2015 17:54
Show Gist options
  • Save poteto/46828d8625ccffc10db0 to your computer and use it in GitHub Desktop.
Save poteto/46828d8625ccffc10db0 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Route.extend({
metrics: Ember.inject.service(),
afterModel(model) {
const metrics = Ember.get(this, 'metrics');
const id = Ember.get(model, 'googleAnalyticsKey');
metrics.activateAdapters([
{ name: 'GoogleAnalytics', config: { id } }
]);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment