Open psi-4ward opened 8 years ago
This should be consulted with Angular's team.
Whilst implementing a TemplateCompiler
in Angular2 may use pug's package.
We support this for react-pug via a Babel plugin. We could do the same for regular pug.
@psi-4ward: Angular 2 just expects an expression that evaluates to a html string. So if Pug can convert it to HTML, then yes, that's fine.
+1 Has anyone figured out a way to do this yet?
@westonganger: you'll find how to use Pug here, this is no different:
let pug = require('pug');
@Component({
template: pug.render('p hi'),
})
Angular team does not care about pug, and now they are encouraging people to use single file components with inline templates, rather than specifying templates in separate files. Any chances that pug team/community will come up with a solution allowing to easily use pug inside inline templates? Using require
in Angular is discouraged, so I was hoping for a better method to do it than the one shown above. I know that this topic is old, but this is something I would actually use all the time. Are there really so few people wanting to use pug with Angular, that this is a niche problem?
Hi there, I'm using webpack for my current Angular2 play. Can i inline pug in my components without using require() ?
Like:
instead of
require('myc.jade')