Skip to content

Instantly share code, notes, and snippets.

@bartocc
Created March 23, 2017 16:22
Show Gist options
  • Save bartocc/7032ca7d69725ed1d11481982dcf10b5 to your computer and use it in GitHub Desktop.
Save bartocc/7032ca7d69725ed1d11481982dcf10b5 to your computer and use it in GitHub Desktop.
observer always fired
import Ember from 'ember';
export default Ember.Component.extend({
aFlag: Ember.computed('foo', function() {
return false;
}),
aFlagChanged: Ember.observer('aFlag', function () {
alert('Why do I appear?');
})
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
foo: 'bar'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{input value=foo}}
{{my-component foo=foo}}
<br>
<br>
my component's foo={{foo}}
{{aFlag}}
{
"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"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment