rave-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Geer <ch...@cxtsoftware.com>
Subject Re: Handlebars templates
Date Sat, 02 Mar 2013 19:36:07 GMT
On Fri, Mar 1, 2013 at 10:13 PM, Erin Noe-Payne <erin.noe.payne@gmail.com>wrote:

> Hey Chris,
> We can definitely do something better. Are your templates using Handlebars?
> If so any markup on the page at load with the
> attribute data-template-for="X" will be handlebars compiled and loaded onto
> rave.ui.templates[x]. We could also add a register method on the namespace
> although I'm not sure that would save you any code really.

That's the rub, even when I built my templates like that they were not
automatically compiled. I believe the issue is that my custom_js is loaded
after the template code has already executed. Honestly, the way things are
written it requires the templates to use handlebars because the createPopup
method looks in that rave.ui.templates[] array and if it doesn't find
anything it fails.

At a minimum I think we need the register method.


> On Fri, Mar 1, 2013 at 8:24 PM, Chris Geer <chris@cxtsoftware.com> wrote:
> > Erin,
> >
> > I upgraded our system to 0.21-SNAPSHOT and ran into a small problem with
> > the handlebar templates. We provide our own open-view popup definitions
> be
> > including them as part of the custom_js.tag file. The challenge we ran
> into
> > was that the code to generate the element for that popup now requires a
> > handlebar template definition to be loaded into the rave.ui.templates
> > array. The current code only loads templates from the
> > client_side_templates.tag file. I was able to put similar methods in my
> > custom files to then modify that array but I think there is probably a
> > better way to do it. What do you think about adding some public methods
> to
> > the rave.ui namespace to register handlebar templates?
> >
> > Chris
> >

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message