Wednesday, 15 March 2017

how to get variable in jade/pug's custom filter

I want to write a filter in jade/pug
this is my filter:

pug.filters.testfilter = function (text) {
  console.log(text);
};

I ues it in .pug file:

li 
  :testfilter
    #{tag.date}

the tag data is {'date': ISODate("2017-03-10T08:17:29.672Z")} I want to get ISODate("2017-03-10T08:17:29.672Z") in testfilter
But when I console.log it, it give me #{tag.date}

how can I get the real value in filters?



via nataila

No comments:

Post a Comment