trying to run handlebars inside Adobe Air project #418

Closed
michapixel opened this Issue Jan 28, 2013 · 3 comments

Projects

None yet

2 participants

@michapixel

i'd like to use handlebars.js inside an adobe air project, but can only use it in a limited way, since the Air runtime restricts the use of eval() and Function calls etc.: http://help.adobe.com/de_DE/AIR/1.1/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7f08.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7f07
the solution provided is of no use for me, since i want a real offline project, ans serving the handlebars.js via a local file triggers the same warning/exception as directly including it.
a micro webserver might be a (quick and dirty) solution to this problem, but since i am definately not a js-guru, i thought i'd ask politely if someone sees a way to replace
"Function.apply(this, params)" from the actual source (line 1385) with something the Air-runtime doesn't see as a violation ...

@michapixel

Ok, seems i'm one step further now, but 5 steps back. I've (kinda) successfully built a bridge liek described in the above link, an i can compile simple things like {{title}} but trying to compile https://github.com/wycats/handlebars.js#usage this example results in ... nothing. i mean {{name}} and {{hometown}} are fine, so is {{kids.length}} but the loop {{#kids}} etc. seems fail silently.

any ideas what that might cause?

@kpdecker
Collaborator

I'm not familiar with the Air runtime or the restrictions that are placed on it. If dynamic code is restricted in that environment I'd recommend using precompiled templates rather than trying to compile them in the app.

In terms of the {{#kids}} iteration issue, does it work if you use {{#each kids}}?

@kpdecker
Collaborator

Closing as this seems to be dead and I believe precompilation should resolve the issue.

@kpdecker kpdecker closed this May 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment