hino / app / components / app-navbar-bottom.js
app-navbar-bottom.js
Raw
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';

export default Component.extend({
    session: service(),
	router: service(),
	homeNotification: service(),

    currentRouteName : computed('router.currentRouteName', {
        get() {
            let currentRoute = this.get('router').get('currentRouteName');
            let currentRouteArr = currentRoute.split(".");
            currentRoute = currentRouteArr[0];
            return currentRoute;
        }
	}),

    init() {
        this._super(...arguments);
    },
    actions: {
        logout() {
            this.get('session').invalidate();
        }
    }
});