Skip to content

Instantly share code, notes, and snippets.

Avatar

Ten Bitcomb Ravenstine

  • DockYard Inc.
  • Monrovia, CA
View GitHub Profile
View components.child\.hbs
<GrandChild ...attributes />
View route-components.md
@Ravenstine
Ravenstine / app\.js
Last active Sep 22, 2020
Named Blocks
View app\.js
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
// const callback = Ember.__loader.registry['@ember/canary-features/index'].callback;
// Ember.__loader.registry['@ember/canary-features/index'].callback = function() {
// const features = callback(...arguments);
// features.EMBER_NAMED_BLOCKS = true;
// // debugger
View ember-template-compiler.js
(function() {
/*!
* @overview Ember - JavaScript Application Framework
* @copyright Copyright 2011-2019 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
* @version 3.16.3
*/
View controllers.application\.js
import Ember from 'ember';
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { htmlSafe } from '@ember/template';
const { precompile } = Ember.__loader.require('ember-template-compiler')
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
View components.nifty-squares\.hbs
<h2>Nifty Squares</h2>
<label for="toggle">Show squares?</label>
<Input id="toggle" @type="checkbox" name="isAdmin" @checked={{this.this.showSquares}} />
<div class="nifty-squares">
{{#if this.showSquares}}
{{yield}}
{{/if}}
</div>
@Ravenstine
Ravenstine / adapters.application\.js
Last active Jun 19, 2020
Ember Custom Elements: Super Rentals
View adapters.application\.js
import Adapter from '@ember-data/adapter';
import RENTALS from '../lib/rentals';
export default class ApplicationAdapter extends Adapter {
findAll() {
return {
data: RENTALS
};
}
@Ravenstine
Ravenstine / components.game-board\.hbs
Last active Aug 5, 2020
Ember Custom Elements: Tic Tac Toe w/ React Demo
View components.game-board\.hbs
{{#each this.rows as |row|}}
<div class="board-row">
{{#each row as |square|}}
<button class="square" {{on "click" (fn this.selectSquare square.index)}}>
{{square.value}}
</button>
{{/each}}
</div>
{{/each}}
View controllers.application\.js
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}