Calling partials with new context

102 views
Skip to first unread message

Jonas Trollvik

unread,
Oct 29, 2013, 11:30:50 AM10/29/13
to handleb...@googlegroups.com
Hi,

I just stumbled upon a weird thing when specifying context to a partial

I called on a partial like this:

{{> hbs/share/share page}}

In the partial I use a helper which accesses context data like this:
PageContext pageContext = options.context
                    .<PageContext> data("pageContext");

However the data returned by the context is null.

However when calling it like this:

{{#page}}
    {{> hbs/share/share}}
{{/page}}

Everything works fine, pageContext is set as it should.

I am using version 1.1.2

Is the child context created without it's parent context in the first case?

We are only manually setting up a handlebars context in one place in the code.

Thanks
//Jonas





edgar

unread,
Oct 31, 2013, 10:22:11 AM10/31/13
to handleb...@googlegroups.com
You're right. Custom partial context are created without parent context.

Can you open a bug at gihub?

Thanks

Jonas Trollvik

unread,
Nov 25, 2013, 9:19:40 AM11/25/13
to handleb...@googlegroups.com
Hi and sorry for the delay.


Kind regards
Jonas



2013/10/31 edgar <espina...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "handlebars.java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to handlebarsjav...@googlegroups.com.
To post to this group, send email to handleb...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/handlebarsjava/bca5e099-62d6-4c54-bc90-ca60cc35b7c2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages