mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Docs for poems service
This commit is contained in:
@@ -10,9 +10,17 @@ angular.module("sideBySide").service "poems", ['$q', 'fetch', ($q, fetch) ->
|
||||
}]
|
||||
@heading = undefined
|
||||
|
||||
# Get active poems
|
||||
#
|
||||
# @return [Array] Active poems
|
||||
@getActive = () ->
|
||||
(poem for poem in @all when poem.meta.Active is true)
|
||||
|
||||
# Activize poem based on passed rules
|
||||
#
|
||||
# @param poem [Object]
|
||||
# @param active [Object] { meta: [ 'active', 'values' ] }
|
||||
# @return poem
|
||||
activize = (poem, active) ->
|
||||
if !active
|
||||
poem.meta.Active = true
|
||||
@@ -22,6 +30,9 @@ angular.module("sideBySide").service "poems", ['$q', 'fetch', ($q, fetch) ->
|
||||
poem.meta.Active = true
|
||||
poem
|
||||
|
||||
# Load poems
|
||||
#
|
||||
# @param base [String]
|
||||
@load = (base = '') =>
|
||||
fetch(base + "/config.json").then (config) =>
|
||||
$q.all(config.promises).then (results) =>
|
||||
|
||||
Reference in New Issue
Block a user