New strict mode possible for templates

0 views
Skip to first unread message

James Burke

unread,
Jul 28, 2010, 12:53:25 AM7/28/10
to raindr...@googlegroups.com
Normally the blade/jig templating module is very lax, any property not
found on an object just results in an empty string. However, after
talking with Bryan, sometimes you want to know if you are applying a
template correctly to a data object. So there is now a way to do this:

Set the global jig.strict property to true (default is false). It will
affect all templates. Or for a specific jig call you can pass strict:
true (or strict: false) in the options argument to turn on/off strict
checking for that call.

Strict checking will just log properties it cannot find to the console
as console.error calls, but still render something. Pull the latest
code to get the capability. I noticed I had trouble with Firebug 1.5
logging the errors sometimes, but Firebug 1.6 alpha seemed to do
better. Although it seems like it is never guaranteed. Using WebKit
with WebKit inspector seems more consistent.

James

Reply all
Reply to author
Forward
0 new messages