Builder.toFragment creates outlet references on the fragment.

This commit is contained in:
Nathan Sobo
2011-12-27 17:43:05 -06:00
parent a7aa1d2b75
commit 43ddb6b16a
2 changed files with 16 additions and 1 deletions

View File

@@ -25,7 +25,12 @@ class Builder
_.map(@document, (x) -> x.toHtml()).join('')
toFragment: ->
$(@toHtml())
fragment = $(@toHtml())
fragment.find('[outlet]').each ->
elt = $(this)
outletName = elt.attr('outlet')
fragment[outletName] = elt
fragment
tag: (name, args...) ->
options = @extractOptions(args)