Angular-ui router loading jade template Angular-ui router loading jade template express express

Angular-ui router loading jade template


Right so express doesn't auto-render views. It will automatically send static files, but not render dynamic views, you so need an explicit route to match the partials and call res.render to convert them from jade to HTML before sending to the browser. Try something along these lines, putting this BEFORE your wildcard route for index.

app.use("/partials", function (req, res) {  res.render(req.path);});


my 2 cents:Why is it necessary for you to have the server render the page?If the reason is that you need to pass in data on initial load (thinking like a JSON string somewhere, something like this), I would do it on bootstrapping (a follow up from the same author on how to go about that).

Barring that reason, I can't really think of any other reason to have the server do the rendering. Compile your jade templates with gulp or better yet in webpack (HTMLWebpack plugin for the landing page is nice).