mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-12-04 18:28:00 +01:00
16 lines
356 B
CoffeeScript
16 lines
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
|
||
|
])
|