Skip to content

Instantly share code, notes, and snippets.

@eriktrom
Last active September 17, 2015 08:42
Show Gist options
  • Save eriktrom/38f3d0389a6eab43e041 to your computer and use it in GitHub Desktop.
Save eriktrom/38f3d0389a6eab43e041 to your computer and use it in GitHub Desktop.

Revisions

  1. eriktrom revised this gist Sep 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion application.controller.js
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ export default Ember.Controller.extend({

    actions: {
    nextVideo() {
    return 'w00t'
    console.log('w00t');
    }
    }
    });
  2. eriktrom revised this gist Sep 17, 2015. 4 changed files with 4 additions and 7 deletions.
    2 changes: 1 addition & 1 deletion application.controller.js
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ export default Ember.Controller.extend({

    actions: {
    nextVideo() {
    console.log("please call me!");
    return 'w00t'
    }
    }
    });
    2 changes: 1 addition & 1 deletion application.template.hbs
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,6 @@
    <br>
    {{outlet}}

    {{next-video-button}}
    {{next-video-button nextVideo=(action 'nextVideo')}}
    <br>
    <br>
    5 changes: 1 addition & 4 deletions next-video-button.component.js
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,5 @@
    import Ember from 'ember';

    export default Ember.Component.extend({
    click() {
    console.log("happens");
    this.sendAction();
    }

    });
    2 changes: 1 addition & 1 deletion next-video-button.template.hbs
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    <button {{action "nextVideo"}}>NEXT VID</button>
    <button {{action attrs.nextVideo}}>NEXT VID</button>
  3. @exophunk exophunk created this gist Sep 17, 2015.
    11 changes: 11 additions & 0 deletions application.controller.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    import Ember from 'ember';

    export default Ember.Controller.extend({
    appName:'Ember Twiddle',

    actions: {
    nextVideo() {
    console.log("please call me!");
    }
    }
    });
    8 changes: 8 additions & 0 deletions application.template.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    <h1>Welcome to {{appName}}</h1>
    <br>
    <br>
    {{outlet}}

    {{next-video-button}}
    <br>
    <br>
    8 changes: 8 additions & 0 deletions next-video-button.component.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    import Ember from 'ember';

    export default Ember.Component.extend({
    click() {
    console.log("happens");
    this.sendAction();
    }
    });
    1 change: 1 addition & 0 deletions next-video-button.template.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    <button {{action "nextVideo"}}>NEXT VID</button>
    9 changes: 9 additions & 0 deletions twiddle.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    {
    "version": "0.4.10",
    "dependencies": {
    "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
    "ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.9/ember.debug.js",
    "ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.11/ember-data.js",
    "ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.9/ember-template-compiler.js"
    }
    }