question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to replace filter functionnality

See original GitHub issue

Hello,

Due to release upgrade my code don’t work anymore due to this piece of code: ejs.filters.toLocaleDateString = function(d) {...}

I wonder how to replace the filters fonctionnality that was in V1 ? Have a guide line for doing that ?

Thank’s in advance,

Jean-Marc

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
IgorDePaulacommented, Mar 26, 2015

My index.ejs is :

Welcome to <%= title %>

<%= menuMounter()%>

In app.js is:

var ejs = require(‘ejs’);

app.locals.menuMounter = function menuMounter() { var menu = require(‘./config/menu.json’); var template = fs.readFileSync(‘./lib/menumounter/menu.ejs’, ‘utf-8’); return ejs.render(template, menu); };

I received this error:

SyntaxError: C:\Users\Analista-02\projetos\teste-express\views\index.ejs:10 8|

<%= title %>

9|

Welcome to <%= title %>

10| <%= menuMounter()%> 11| </body> 12| </html> 13|

Unexpected token % while compiling ejs

2015-03-26 16:58 GMT-03:00 Matthew Eernisse notifications@github.com:

Oop, sorry, distracted, totally misread your code. <%- is indeed a valid opening tag. It just doesn’t escape the output.

— Reply to this email directly or view it on GitHub https://github.com/mde/ejs/issues/76#issuecomment-86690368.

1reaction
mdecommented, Mar 26, 2015

Filters were removed in v2; they weren’t part of core EJS functionality, and they’re easy to implement with your own helpers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the CALCULATE function to replace filters
The CALCULATE function is the most important one in DAX. This blog shows you how to use it to replace, remove and amend...
Read more >
How to replace filtered data without disabling filter in Excel?
Replace filtered data with exchanging filtered data with other ranges · 1. Click the Kutools > Range > Swap Ranges. · 2. In...
Read more >
Filter data in a range or table - Microsoft Support
Select any cell within the range. · Select Data > Filter. Filter button · Select the column header arrow Filter arrow . ·...
Read more >
Excel FILTER function with formula examples - Ablebits
The results of the Excel FILTER function are dynamic, meaning they update automatically when values in the original data set change.
Read more >
Car Engine Filter: What Is It & How to Replace One | Allstate
Your engine air filter can be likened to the "lungs" of your car. In order for the air filter to run efficiently, function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found