Pony.fm/resources/assets/scripts/app/services/dashboard.coffee
2015-10-24 19:35:37 -07:00

16 lines
465 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
])