I have a simple nodejs/express application by this example. In that view there is checking everyauth.loggedIn variable, but in my application I don’t use everyauth module I use the following code instead: req.session.auth = user; How can I get access to req.session.auth in a view in this case?
I need to generate following html markup in jade <div class=”checkbox”> <label> <input type=”checkbox”> Remember me </label> </div> My try:- .checkbox label Remember me input(type=”checkbox”) generates <div class=”checkbox”> <label> “Remember me ” <input type=”checkbox”> </label> </div> How can we place element “checkbox” infront of “Remember me” label text?
I need to use “fs” module inside a Jade file. No other JS file. When I try: – var js = require(‘fs’) – var downloadfiles = readdirSync(“download”) for f in downloadfiles url loc= D + “/download” + f lastmod= buildDate changefreq daily priority 1.0 I got the error “undefined is not a function”
Is there a way to write inline css using Jade for Node? My HTML is: <div class=”column” style=”text-align:center;”></div> but I can’t see any reference to this in the guides.
Coming from the world of express, if there was an error when compiling a Jade template, the error would output to the browser with details of the template error including line number. I would like to see this level of error detail in Hapi.js when the view template compiler encounters an error. Instead, with Hapi.js, […]
I’m using Jade as a templating engine for my Express powered node.js application. Maybe it’s late in night, but I can’t figure out where empty style element inserted in resulting HTML. Live example: http://quotation-mark.herokuapp.com/ (noticed that <style type=”text/css”></style> at the very end of head?) Express’ templates setup: app.set(‘views’, settings.projectDir + ‘/views’); app.set(‘view engine’, ‘jade’); app.set(‘view […]
I’m trying to render a table using jade from a simple array of objects. But instead of simply rendering one row per object, I want to render three objects on each row. <table> <thead>…</thead> <tbody> <tr> <td>obj0</td> <td>obj1</td> <td>obj2</td> </tr> <tr> <td>obj3</td> <td>obj4</td> <td>obj5</td> </tr> … </tbody> </table
I’ve read a lot of posts on the subject, found almost always the same solution but it does not work for me… My problem is as follows : I want to use Twitter Bootstrap 2.3.2 and its navbar, so I include the css and js files. Just before that, I also include jquery. I then […]
I’m new to nodejs and was wondering if anyone knew how to debug this error: TypeError: Property ‘engine’ of object #<View> is not a function I’ve just installed an express instance after a bit of work getting node/npm installed on an ubuntu box. Any ideas? Here’s my stack trace: 500 TypeError: Property ‘engine’ of object […]