Guest User

Untitled

a guest
Jun 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import Ember from 'ember';
  2.  
  3. export default Ember.Controller.extend({
  4. init() {
  5. this.set('foo', {
  6. bar: 'abc'
  7. });
  8.  
  9. this.set('baz', Ember.Object.create({
  10. quux: 'def'
  11. }));
  12. },
  13.  
  14. actions: {
  15. fooBarChange(value) {
  16. if (/^[a-z]*$/.test(value)) {
  17. this.set('foo.bar', value);
  18. }
  19.  
  20. // This doesn't work
  21. this.notifyPropertyChange('foo.bar');
  22. },
  23.  
  24. barQuuxChange(value) {
  25. if (/^[a-z]*$/.test(value)) {
  26. this.set('baz.quux', value);
  27. }
  28.  
  29. this.get('baz').notifyPropertyChange('quux');
  30. }
  31. }
  32. });
Add Comment
Please, Sign In to add comment