mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-22 13:40:40 +08:00
22 lines
392 B
CoffeeScript
22 lines
392 B
CoffeeScript
angular.module("sideBySide").service "poems", ['$rootScope', '$q', 'fetch', ($rootScope, $q, fetch) ->
|
|
poems = []
|
|
heading = undefined
|
|
|
|
@update = (config) ->
|
|
fetch(config).then((result) ->
|
|
$q.all(result.promises).then((results) ->
|
|
poems = results
|
|
heading = result.heading
|
|
$rootScope.$emit "poemsLoaded"
|
|
)
|
|
)
|
|
|
|
@get = () ->
|
|
poems
|
|
|
|
@getHeading = () ->
|
|
heading
|
|
|
|
@
|
|
]
|