2021-03-08 12:15:54 +00:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import { action } from '@ember/object';
|
|
|
|
import { tracked } from '@glimmer/tracking';
|
|
|
|
|
|
|
|
export default class RouteComponent extends Component {
|
|
|
|
@service('routlet') routlet;
|
2021-09-15 18:50:11 +00:00
|
|
|
@service('router') router;
|
2021-03-08 12:15:54 +00:00
|
|
|
|
|
|
|
@tracked model;
|
|
|
|
|
2021-05-26 16:43:46 +00:00
|
|
|
get params() {
|
|
|
|
return this.routlet.paramsFor(this.args.name);
|
|
|
|
}
|
|
|
|
|
2021-03-08 12:15:54 +00:00
|
|
|
@action
|
|
|
|
connect() {
|
|
|
|
this.routlet.addRoute(this.args.name, this);
|
|
|
|
}
|
2021-04-06 12:40:40 +00:00
|
|
|
|
2021-03-08 12:15:54 +00:00
|
|
|
@action
|
|
|
|
disconnect() {
|
|
|
|
this.routlet.removeRoute(this.args.name, this);
|
|
|
|
}
|
|
|
|
}
|