

The code seems to be correct, but it does not work. For example here: render inline Javascript with jade/pug In pug, for example, I can embed Javascript, but template engines do not seem to be made to implement user events - because in the documentation as well as here on Stack Overflow I don't find a "standard solution" for embedding JS scripts, at best workarounds and embedding JS directly in pug (not the reference to a script). I stumble upon how to get the events into the template engine. Now I have a conceptual question: Is the approach with NodeJS and a template engine right for this? The app should work similar to an editor and react to different user events. For the most part, Angular template language syntax remains unchanged in a Pug template, however, when it comes to binding and some directives (as described above), you need to use quotes and commas since (),, and () interfere with the compilation of Pug templates. Pug is simply too alien from native HTML and resembles a lot more like those other off-side rule languages like Python.I want to create an app using NodeJS, Express and Pug. Angular Template Language Syntax In Pug Templates.

Pug templates are nice for Python programmers who don't want to learn HTML to start writing web pages and develop some entire websites personally from the ground up, but for any serious project that involves more than half a dozen people and has separate positions of web UI designers, front-end developers, and back-end engineers, it's much better to choose something more closely compatible with native HTML as the template engine. This is generally not a problem for block-level elements like paragraphs, because they will still render as separate paragraphs in the web browser (unless you have changed their CSS display property).

So, the closing tag of an HTML element will touch the opening tag of the next. Off-side rule templating language not working well with native HTML plain HTML pages usually can contain very deeply nested structures, whether they are hand-written by web UI designers or generated from popular web design tools or taken from existing HTML templates, which are a nightmare for front-end engineers to convert into Pug templates, where you have to take care of handling the indentation rules and the deeply nested HTML elements, even creating multiple blocks that don't have any meaning in terms of business logic, just to house the HTML elements within bearable amounts of indentations. Pug removes indentation, and all whitespace between elements.
