Skip to content

Instantly share code, notes, and snippets.

@pbishop16
Last active December 24, 2017 04:16
Show Gist options
  • Save pbishop16/ecc22e60e45e4fb0390c9756f07a84ee to your computer and use it in GitHub Desktop.
Save pbishop16/ecc22e60e45e4fb0390c9756f07a84ee to your computer and use it in GitHub Desktop.

Revisions

  1. pbishop16 revised this gist Dec 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion templates.components.increment-component.hbs
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    <h2>Temperature:</h2>
    <h3>{{heat}}</h3>
    <h3>Current: {{heat}}</h3>
    <button {{action "increaseHeat"}}>Add Heat</button>
  2. pbishop16 created this gist Dec 24, 2017.
    16 changes: 16 additions & 0 deletions components.increment-component.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    import Ember from 'ember';

    export default Ember.Component.extend({
    heat: 0,

    init() {
    this._super(...arguments);
    this.set('errors', []);
    },

    actions: {
    increaseHeat() {
    this.incrementProperty('heat');
    },
    },
    });
    5 changes: 5 additions & 0 deletions controllers.application.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    import Ember from 'ember';

    export default Ember.Controller.extend({
    appName: 'Ember Twiddle'
    });
    6 changes: 6 additions & 0 deletions templates.application.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <h1>Welcome to {{appName}}</h1>
    <br>
    <br>
    {{increment-component}}
    <br>
    <br>
    3 changes: 3 additions & 0 deletions templates.components.increment-component.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    <h2>Temperature:</h2>
    <h3>{{heat}}</h3>
    <button {{action "increaseHeat"}}>Add Heat</button>
    19 changes: 19 additions & 0 deletions twiddle.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    {
    "version": "0.12.1",
    "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.12.0",
    "ember-template-compiler": "2.12.0",
    "ember-testing": "2.12.0"
    },
    "addons": {
    "ember-data": "2.12.1"
    }
    }