Pony.fm/public/scripts/app/services/dashboard.coffee
2013-07-31 06:47:16 -05:00

16 lines
No EOL
356 B
CoffeeScript

angular.module('ponyfm').factory('dashboard', [
'$rootScope', '$http'
($rootScope, $http) ->
def = null
self =
refresh: (force) ->
force = force || false
return def if !force && def
def = new $.Deferred()
$http.get('/api/web/dashboard').success (dashboardContent) ->
def.resolve(dashboardContent)
def.promise()
self
])