Last active
September 23, 2016 13:54
-
-
Save Turbo87/1b7c9053d07a483a0b70ef25f4afb1bd to your computer and use it in GitHub Desktop.
glimmer-issue
This file contains 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
myService: Ember.inject.service(), | |
init() { | |
this._super(...arguments); | |
this.set('controllerArray', ['xxx']); | |
}, | |
serviceArrayCP: Ember.computed('myService.serviceArray.[]', function() { | |
return this.get('myService.serviceArray'); | |
}), | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Helper.extend({ | |
compute(value, hash) { | |
this.clearTimer(); | |
this.timer = Ember.run.later(this, this.recompute, 1000); | |
return new Date(); | |
}, | |
clearTimer() { | |
Ember.run.cancel(this.timer); | |
}, | |
destroy(...args) { | |
this._super(...args); | |
this.clearTimer(); | |
} | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Route.extend({ | |
setupController(controller) { | |
this._super(...arguments); | |
controller.get('myService')._runOnce(); | |
} | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Service.extend({ | |
init() { | |
this._super(...arguments); | |
this.set('serviceArray', Ember.A()); | |
}, | |
_runOnce() { | |
// this._pushObj(); | |
Ember.run.once(this, this._pushObj); | |
}, | |
_pushObj() { | |
console.log('_pushObj'); | |
this.get('serviceArray').pushObject('foo'); | |
}, | |
}); |
This file contains 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.10.5", | |
"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.9.0-beta.3", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "2.9.0-beta.3", | |
"ember-testing": "2.9.0-beta.3" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment