Last active
July 12, 2021 10:44
-
-
Save JohnnyBushy/961e319a1800a66585658d08dd4d5ba0 to your computer and use it in GitHub Desktop.
Revisions
-
JohnnyBushy revised this gist
Jul 12, 2021 . No changes.There are no files selected for viewing
-
JohnnyBushy revised this gist
Jul 10, 2021 . 5 changed files with 35 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,6 @@ export default class extends Route { @service store; model() { return this.store.createRecord('post', {content: 'Some post content here'}); } }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ <p>{{@post.content}}</p> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ import { module, test } from 'qunit'; import { visit, currentURL } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; module('TODO: put something here', function(hooks) { setupApplicationTest(hooks); test('visiting /', async function(assert) { await visit('/'); assert.equal(currentURL(), '/'); // After the test is complete, there is an error thrown in the console // Attempted to handle event `willCommit` on <post:null> while in state root.empty. }); }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ import Application from '../app'; import config from '../config/environment'; import { setApplication } from '@ember/test-helpers'; import { assign } from '@ember/polyfills'; import { start } from 'ember-qunit'; let attributes = { rootElement: '#test-root', autoboot: false }; attributes = assign(attributes, config.APP); let application = Application.create(attributes); setApplication(application); start(); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ }, "options": { "use_pods": false, "enable-testing": true }, "dependencies": { "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js", -
JohnnyBushy created this gist
Jul 10, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import Component from '@glimmer/component'; export default class extends Component { willDestroy() { this.args.post.save(); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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'; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ import Model from 'ember-data/model'; import attr from 'ember-data/attr'; export default class extends Model { @attr('string') content; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; export default class extends Route { @service store; model() { return this.store.createRecord('post', {content: 'Some content here'}); } }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <MyComponent @post={{@model}} /> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <p>{{post.content}}</p> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ { "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", "ember-data": "3.18.0" } }