2019-10-24 00:39:32 +08:00
|
|
|
import Route from "@ember/routing/route";
|
|
|
|
export default Route.extend({
|
2016-08-25 02:35:07 +08:00
|
|
|
model(params) {
|
2016-08-26 01:14:56 +08:00
|
|
|
const allSteps = this.modelFor("application").steps;
|
2016-10-27 03:44:36 +08:00
|
|
|
const step = allSteps.findBy("id", params.step_id);
|
2016-09-01 01:35:49 +08:00
|
|
|
return step ? step : allSteps[0];
|
2016-08-25 02:35:07 +08:00
|
|
|
},
|
|
|
|
|
2016-08-26 01:14:56 +08:00
|
|
|
setupController(controller, step) {
|
2016-09-20 04:11:15 +08:00
|
|
|
this.controllerFor("application").set("currentStepId", step.get("id"));
|
|
|
|
|
2016-08-26 01:14:56 +08:00
|
|
|
controller.setProperties({
|
|
|
|
step,
|
|
|
|
wizard: this.modelFor("application"),
|
|
|
|
});
|
2016-08-25 02:35:07 +08:00
|
|
|
},
|
|
|
|
});
|