Quantcast
Viewing all articles
Browse latest Browse all 4838

Share code between routes

@emanuk wrote:

ember-cli: 2.13.2 node: 7.8.0

Hello, I'm a newbie at Ember.

I have a route with this code to set a body class. I will use this code on a couple of routes but not all. I was wondering if it's possible to share this code between routes?

TIA

-Emmanuel

import Ember from 'ember';

export default Ember.Route.extend({
  activate () {
    Ember.$('body').addClass('loading-authentification');
  },
  deactivate () {
    Ember.$('body').removeClass('loading-authentification');
  }
});

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles