Skip to content

Instantly share code, notes, and snippets.

@jkeen
Last active April 24, 2020 15:30
Show Gist options
  • Save jkeen/d6a5b8ec8886cf86df947beee9fd6180 to your computer and use it in GitHub Desktop.
Save jkeen/d6a5b8ec8886cf86df947beee9fd6180 to your computer and use it in GitHub Desktop.
New Twiddle
import Component from '@glimmer/component';
export default class CalendarGrid extends Component {
get cells() {
if (this.args.span == 'week') {
return [1,2,3,4,5,6,7];
}
else {
return [1];
}
}
}
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
get calendarSpan() {
if (window.innerWidth > 0) {
return 'week';
}
else {
return 'day';
}
}
}
<CalendarGrid @span={{this.calendarSpan}}/>
<div class="calendar-cell">
{{value}}
</div>
{{#each this.cells as |value|}}
<CalendarCell @value={{value}} />
{{/cell}}
{
"version": "0.17.0",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": true,
"_APPLICATION_TEMPLATE_WRAPPER": false,
"_JQUERY_INTEGRATION": false
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"ember": "3.17.0",
"ember-template-compiler": "3.17.0",
"ember-testing": "3.17.0"
},
"addons": {
"@glimmer/component": "1.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment