Created
April 15, 2013 16:00
-
-
Save unr/5389172 to your computer and use it in GitHub Desktop.
Example of my Project model.
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
App.Project = Em.Object.extend | |
# Trying to optimize phase load times | |
showPhases: false | |
phases: (-> | |
if !@_children | |
@set '_children', Em.A() | |
childPhases = @get('childPhases') | |
if childPhases | |
childPhases.forEach( (phase) => | |
Ember.run.once(this, -> | |
phase.active = (phase.active is '1') ? true : false | |
@_children.addObject App.Phase.create(phase) | |
) | |
) | |
Ember.run.next(this, -> | |
@set('showPhases', true) | |
) | |
return @_children | |
).property('_children', 'childPhases', 'showPhases') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment