Skip to content

Instantly share code, notes, and snippets.

@bracke
Last active December 22, 2021 08:37

Revisions

  1. bracke revised this gist Dec 22, 2021. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions router\.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    import EmberRouter from '@ember/routing/router';
    import config from './config/environment';

    const Router = EmberRouter.extend({
    location: 'none',
    rootURL: config.rootURL
    });

    Router.map(function() {
    this.route('parent', function () {
    this.route('child');
    });
    });

    export default Router;
  2. bracke revised this gist Dec 22, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion routes.parent\.js
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ import Route from '@ember/routing/route';

    export default Route.extend({

    @service router;
    @service router,

    beforeModel(transition)
    {
  3. bracke created this gist Dec 22, 2021.
    5 changes: 5 additions & 0 deletions controllers.application\.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    import Controller from '@ember/controller';

    export default class ApplicationController extends Controller {
    appName = 'Ember Twiddle';
    }
    4 changes: 4 additions & 0 deletions routes.parent.child\.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    import Route from '@ember/routing/route';

    export default Route.extend({
    });
    12 changes: 12 additions & 0 deletions routes.parent\.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import Route from '@ember/routing/route';

    export default Route.extend({

    @service router;

    beforeModel(transition)
    {
    this.router.transitionTo('parent.child');
    }

    });
    6 changes: 6 additions & 0 deletions templates.application\.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@

    <br>
    <br>
    {{outlet}}
    <br>
    <br>
    1 change: 1 addition & 0 deletions templates.parent.child\.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    <h1>Child</h1>
    1 change: 1 addition & 0 deletions templates.parent\.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {{outlet}}
    22 changes: 22 additions & 0 deletions twiddle\.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    {
    "version": "0.17.1",
    "EmberENV": {
    "FEATURES": {},
    "_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false,
    "_APPLICATION_TEMPLATE_WRAPPER": true,
    "_JQUERY_INTEGRATION": true
    },
    "options": {
    "use_pods": false,
    "enable-testing": false
    },
    "dependencies": {
    "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js",
    "ember": "3.18.1",
    "ember-template-compiler": "3.18.1",
    "ember-testing": "3.18.1"
    },
    "addons": {
    "@glimmer/component": "1.0.0"
    }
    }