mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-21 13:30:27 +08:00
17 lines
447 B
CoffeeScript
17 lines
447 B
CoffeeScript
angular.module("sideBySide").factory "fetch", ['$http', 'readerFactory', ($http, readerFactory) ->
|
|
# Fetch
|
|
#
|
|
# @param file [String] Path to config file
|
|
# @return TODO
|
|
return (file = "config.json") ->
|
|
$http.get(file).then((response) ->
|
|
promises = []
|
|
for poem in response.data.files
|
|
promises.push($http.get(poem).then((response) ->
|
|
reader = readerFactory(poem)
|
|
return reader(response.data)
|
|
))
|
|
return promises
|
|
)
|
|
]
|