custom-index.js.es6 431 B

123456789101112131415161718
  1. export default Ember.Route.extend({
  2. beforeModel() {
  3. const appModel = this.modelFor('custom');
  4. if (appModel) {
  5. if (appModel.completed) {
  6. this.set('completed', true);
  7. } else if (appModel.start) {
  8. this.replaceWith('custom.step', appModel.start);
  9. }
  10. }
  11. },
  12. setupController(controller) {
  13. const completed = this.get('completed');
  14. controller.set('completed', completed);
  15. }
  16. });