Skip to content

Instantly share code, notes, and snippets.

@alexgb
Created March 26, 2018 20:42
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 alexgb/cdec622cbd8d91dbbc417ce0f13bfc67 to your computer and use it in GitHub Desktop.
Save alexgb/cdec622cbd8d91dbbc417ce0f13bfc67 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
startDate: null,
didReceiveAttrs() {
this._super(...arguments);
},
actions: {
updateStartDate(date) {
this.onUpdateStartDate(date);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['startDate'],
startDate: null
});
<br>
<br>
{{#link-to (query-params startDate="2018-03-01")}}2018-03-01{{/link-to}}
{{#link-to (query-params startDate="2018-02-15")}}2018-02-15{{/link-to}}
<br>
<br>
{{my-component
startDate=startDate
onUpdateStartDate=(action mut startDate)}}
<div style="border: 1px solid grey;">
<strong>startDate:</strong>{{startDate}}
<a {{action "updateStartDate" "2018-04-30"}}>2018-04-30</a>
</div>
{
"version": "0.13.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.10.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment