Last active
December 20, 2015 05:29
-
-
Save HPieters/6078918 to your computer and use it in GitHub Desktop.
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
App.ApplicationRoute = Ember.Route.extend({ | |
model: function() { | |
return App.Pools.find(); | |
} | |
}); |
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
App.ApplicationController = Ember.Controller.extend({ | |
init: function() { | |
/* Ow boy this feels so wrong */ | |
App.Pools.find(); | |
App.Pools.find({}).then(function(obj) { | |
var length = App.Pools.all().content.length; | |
App.Global.set('pools', length); | |
}); | |
App.Server.find(); | |
App.Server.find({}).then(function(obj) { | |
var length = App.Server.all().content.length; | |
App.Global.set('number', length); | |
}); | |
} | |
}); |
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
App.Pools = DS.Model.extend({ | |
poolName: DS.attr('string'), | |
servers: DS.hasMany('App.Server') | |
}); |
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
App.Server = DS.Model.extend({ | |
hostUrl: DS.attr('string'), | |
pool: DS.belongsTo('App.Pools') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment