Files
side-by-side/source/documents/scripts/services/poems.js.coffee
T

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
@
]