Created
July 22, 2020 02:42
-
-
Save mehulkar/c04372eadc4452ba7a48b26e863095ed to your computer and use it in GitHub Desktop.
notifyPropertyChange
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 characters
import Controller from '@ember/controller'; | |
import { computed } from '@ember/object'; | |
let counter = 0; | |
export default Controller.extend({ | |
appName: 'Ember Twiddle', | |
foo: 1, | |
bar: computed('foo', function() { | |
counter++; | |
return this.get('foo') + counter + 1; | |
}), | |
actions: { | |
notify() { | |
this.notifyPropertyChange('foo'); | |
} | |
} | |
}) |
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 characters
{ | |
"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.8.3", | |
"ember-template-compiler": "3.8.3", | |
"ember-testing": "3.8.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment