BorisMoore/jsrender — Issue #10: Suggestion: More intuitive syntax for simple if comparisons
Author: dswitzer
Created: 2011-10-21 14:58:06+00:00
State: open

The syntax for implementing simple comparisons is overly complex and I think there should be simpler method for adding simple comparisons to your template code.

For example, in jquery.tmpl, you could do:

```

${varName}

```

However, this simple comparison is much more difficult in the new engine. First, you've got to set:

```
$.views.allowCode = true;
```

And then your template ends up looking something like this:

```

{{=varName}}

```

This is quite a bit more complicated to implement and much more difficult to interpret.

Any chance of being able to implement something like:

```

{{=varName}}

```

Where we have some functional helpers like equals(), not(), gt(), lt(), gte(), lte()--and with the potential to define more helper functions.

I can understand dropping to code view for more complex operations, but it seems like there should be a way to at least perform some simple comparisons w/out having to drop to the overly complex code syntax.