2

I'm completely baffled by swig templating in node. How do I subtract two values?

Neither of the following works:

{{ stop - start }}
{{ stop|add(-start) }}

I ended up having to compute this in the view and pass it in. Is that the only way? I guess I could write my own subtract filter, but that seems like a bad solution.

4

1 回答 1

1

现在,您必须编写一个自定义过滤器。

在正在进行完全重写的下一版 Swig 中,您将能够在 variables 中使用简单的运算符

于 2013-07-26T15:11:36.447 回答