hino / app / routes / home / index.js
index.js
Raw
import Route from '@ember/routing/route';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
import { inject as service } from '@ember/service';

export default Route.extend(AuthenticatedRouteMixin, {
	homeNotification: service(),
	homeNotificationData: service(),

	model() {
		// let data = this.store.queryRecord('homeNotification', {me:true});
		let data = this.homeNotificationData.getDataQuery({me:true});
		this.homeNotification.setModel(data);
		this.set('data', data);
		return {};
	},

	setupController(controller, model) {
		this._super(...arguments);
		controller.set('model', this.get('data'));
	}
});