Add disconnect route
This commit is contained in:
parent
f7142fa125
commit
2e4b5a0337
@ -9,6 +9,7 @@ const Router = EmberRouter.extend({
|
|||||||
Router.map(function() {
|
Router.map(function() {
|
||||||
this.route('inspect');
|
this.route('inspect');
|
||||||
this.route('connect');
|
this.route('connect');
|
||||||
|
this.route('disconnect');
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Router;
|
export default Router;
|
||||||
|
13
app/routes/disconnect.js
Normal file
13
app/routes/disconnect.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import Route from '@ember/routing/route';
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
|
|
||||||
|
export default Route.extend({
|
||||||
|
|
||||||
|
storage: service(),
|
||||||
|
|
||||||
|
beforeModel() {
|
||||||
|
this.get('storage.rs').disconnect();
|
||||||
|
this.transitionTo('connect');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
1
app/templates/disconnect.hbs
Normal file
1
app/templates/disconnect.hbs
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{outlet}}
|
10
tests/unit/routes/disconnect-test.js
Normal file
10
tests/unit/routes/disconnect-test.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { moduleFor, test } from 'ember-qunit';
|
||||||
|
|
||||||
|
moduleFor('route:disconnect', 'Unit | Route | disconnect', {
|
||||||
|
needs: ['service:storage']
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it exists', function(assert) {
|
||||||
|
let route = this.subject();
|
||||||
|
assert.ok(route);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user