jgrenon / angular-desktop-app

This is a simple application skeleton to create desktop application using AngularJS. This application is using node-webkit as our desktop host, bower to install client-side libraries as well as normal npm modules as supported by node-webkit.
MIT License
237 stars 57 forks source link

Jade Templating #14

Closed JProffitt71 closed 10 years ago

JProffitt71 commented 10 years ago

When using extends/include in Jade, the parser silently fails because it can't handle relative paths without passing the filename in options, resulting in a white screen.

I fixed this by modifying views.js and adding a path to each template, passed to the compile method:

            templates[f.substring(0, f.length - 5)] = {
                tmplfile:fs.readFileSync(path.resolve('./views', f)),
                tmplpath: path.resolve('./views', f),
                compiled:false
            };
...
                    tmpl.tmpl = jade.compile(tmpl.tmplfile, {'filename': tmpl.tmplpath});
jgrenon commented 10 years ago

I’ll review your code and integrate the solution into the master branch.
Thanks for your help! Joel

On Saturday, July 19, 2014 at 20:44, JProffitt71 wrote:

When using extends/include in Jade, the parser silently fails because it can't handle relative paths without passing the filename in options, resulting in a white screen. I fixed this by modifying views.js and adding a path to each template, passed to the compile method: templates[f.substring(0, f.length - 5)] = { tmplfile:fs.readFileSync(path.resolve('./views', f)), tmplpath: path.resolve('./views', f), compiled:false }; ... tmpl.tmpl = jade.compile(tmpl.tmplfile, {'filename': tmpl.tmplpath});

— Reply to this email directly or view it on GitHub (https://github.com/jgrenon/angular-desktop-app/issues/14).

jgrenon commented 10 years ago

You improvement will be included in the next release. thanks