简体   繁体   中英

jade template helpers in node.js and browser

I use Jade templates both in express app and in the browser. I need to format data before placing it in inputs.

Should I extend locals with alike both in node.js and in browser?

{ formatDate: function(date) {}, ... }

Or are there any best practices to pass helper functions (eg to format money, dates etc.) to jade templates?

最终扩展了服务器端和客户端的本地人。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM