Add Template.toHtml

This commit is contained in:
Corey Johnson & Nathan Sobo
2011-12-28 16:29:40 -06:00
parent 3869193d33
commit cc2b28451c

View File

@@ -17,6 +17,9 @@ class Template
@build: (attributes) ->
(new this).build(attributes)
@toHtml: (attributes) ->
(new this).toHtml(attributes)
build: (attributes) ->
@builder = new Builder
@content(attributes)
@@ -28,6 +31,11 @@ class Template
view.initialize?(attributes)
view
toHtml: (attributes) ->
@builder = new Builder
@content(attributes)
@builder.toHtml()
wireOutlets: (view) ->
view.find('[outlet]').each ->
elt = $(this)