Pony.fm/resources/assets/scripts/app/services/dashboard.coffee

16 lines
356 B
CoffeeScript
Raw Normal View History

2015-08-31 17:42:21 +02:00
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
])