Skip to content

Instantly share code, notes, and snippets.

@HeroicEric
Created May 20, 2020 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HeroicEric/29dd9ad4820bdf987c92eb7acf1d7697 to your computer and use it in GitHub Desktop.
Save HeroicEric/29dd9ad4820bdf987c92eb7acf1d7697 to your computer and use it in GitHub Desktop.
@model bug
import Component from '@glimmer/component';
export default class extends Component {
willDestroy() {
// this.args.person here is missing when it is called as a result of transitioning to another route
console.log({ person: this.args.person });
}
}
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('some-other-route');
});
export default Router;
import Route from '@ember/routing/route';
export default class IndexRoute extends Route {
model() {
return {
firstName: 'Little',
lastName: 'Sebastian'
};
}
}
<div style="margin-bottom: 2rem;">
<LinkTo @route="index" style="margin-right: 2rem;">
Index
</LinkTo>
<LinkTo @route="some-other-route">
Link to other route
</LinkTo>
</div>
{{outlet}}
<div style="border: 1px solid red;">
<p>{{@person.firstName}} {{@person.lastName}}</p>
</div>
<Person @person={{@model}} />
{
"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"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment