Created
March 9, 2016 17:16
-
-
Save Mariusio/15cdca47281f7f03a028 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/routes/application.js | |
import Ember from 'ember'; | |
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin'; | |
export default Ember.Route.extend(ApplicationRouteMixin, { | |
session: Ember.inject.service('session'), | |
authenticated: Ember.computed.oneWay('session.isAuthenticated'), | |
model() { | |
if (this.get('authenticated')) { | |
return Ember.RSVP.hash({ | |
datasources: this.store.findAll('datasource') | |
}); | |
} | |
}, | |
setupController(controller, model) { | |
console.log("setupController of application.js called"); | |
if (this.get('authenticated')) { | |
controller.set('datasources', model.datasources); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment