Skip to content

Instantly share code, notes, and snippets.

@arthur5005
Last active February 20, 2017 23:27

Revisions

  1. arthur5005 revised this gist Feb 20, 2017. 2 changed files with 3 additions and 2 deletions.
    3 changes: 2 additions & 1 deletion controllers.application.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    import Ember from 'ember';

    export default Ember.Controller.extend({
    appName: 'Ember Twiddle',
    appName: 'Notify Property Change Doesn\'t Force a Rerender',
    value: null,
    actions: {
    setValueToNull() {
    @@ -10,6 +10,7 @@ export default Ember.Controller.extend({
    },
    setValueToFoo() {
    this.set('value', 'foo');
    this.notifyPropertyChange('value');
    }
    }
    });
    2 changes: 1 addition & 1 deletion templates.application.hbs
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    <h1>Welcome to {{appName}}</h1>
    <h1>{{appName}}</h1>
    <br>
    <br>
    {{outlet}}
  2. arthur5005 created this gist Feb 20, 2017.
    16 changes: 16 additions & 0 deletions controllers.application.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    import Ember from 'ember';

    export default Ember.Controller.extend({
    appName: 'Ember Twiddle',
    value: null,
    actions: {
    setValueToNull() {
    this.set('value', null);
    this.notifyPropertyChange('value');
    },
    setValueToFoo() {
    this.set('value', 'foo');
    }
    }
    });

    9 changes: 9 additions & 0 deletions templates.application.hbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <h1>Welcome to {{appName}}</h1>
    <br>
    <br>
    {{outlet}}
    <input value={{value}}>
    <button {{action "setValueToNull"}}>Set Value to null!</button>
    <button {{action "setValueToFoo"}}>Set Value to Foo!</button>
    <br>
    <br>
    18 changes: 18 additions & 0 deletions twiddle.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    {
    "version": "0.11.0",
    "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.10.2",
    "ember-data": "2.11.0",
    "ember-template-compiler": "2.10.2",
    "ember-testing": "2.10.2"
    },
    "addons": {}
    }