AndreyM
AndreyM

Reputation: 1413

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 (e.g. to format money, dates etc.) to jade templates?

Upvotes: 2

Views: 1241

Answers (1)

AndreyM
AndreyM

Reputation: 1413

Ended up extending locals both server- and client-side.

Upvotes: 1

Related Questions