Questions tagged as 'pug'

1
answer

Mark the first radio button generated with a loop in pug

I'm using pug to generate a list of radio buttons using a while loop: - var n = 0; while n < 11 input(type="radio", name="cb", id="cb"+n, value=n) label(for="cb"+n) #{n++} The problem is that in this way none is marked by de...
asked by 17.07.2018 / 18:46
2
answers

How to send an object / array from node to pug (jade) and render it?

Since node, I have something like this: var nombres = ['Saab','Volvo','BMW']; app.get('/', function(req, res){ res.render('index', {nombres: nombres}); }); then in pug: - var nombres1 = {nombres}; html(lang="es") head title= "Itris INF...
asked by 26.07.2017 / 02:31
1
answer

Insert JavaScript variable to a Form action. with pug / jade

I need to insert the value of a javascript variable at action of a form The Script is this: var url = window.location; var urlcomplete = url.href; var urlparts = urlcomplete.split("/"); var years = urlparts[urlparts.l...
asked by 02.02.2018 / 17:57
1
answer

Menu nav single page

I have this menu in nodejs (jade / pug) extends ../templates/default block content nav#colorNav ul li.green a.icon-home(href='#') ul li a(href='#') Generar li...
asked by 06.06.2017 / 19:21
1
answer

Error creating a variable outside the Script. with jade / pug

I have a variable of this type: - var route = "/app/imagenes/"+location.href.split("/")[location.href.split("/").length - 2]; which generates the following error:    Can not read property 'href' of undefined but when I put it in a...
asked by 05.02.2018 / 15:50
0
answers

Pug in angle 6 does not consider brackets or elements without value in the template

I have been working with jade and angularJS 1.x using Prepos; Now that I have migrated to angular 6+ angular material I have the problem that the HTML result of the compilation of pug does not consider the following: mat-icon.my-icon(*ngIf="es...
asked by 30.10.2018 / 17:40
1
answer

How to make a post from Express to return a Json with the variables entered in a form?

Hello everyone and thanks for the help! I have the following problem and I am new to Express, it is for a work project. What I need is to make a post from a form and that the answer is a JSON with the data entered in the form. I'm using...
asked by 12.09.2018 / 18:42
0
answers

problem with share in a .pug file

I have a problem with the share button on my website with the .pug file I created a script as follows: script(type='text/javascript'). //Funciones para compartir en redes sociales function share_fb(url, title_share, width,heig...
asked by 18.05.2018 / 21:12
0
answers

Problems showing images with PUG

I am designing a CRUD with images, using Mongodb with Nodejs and for the PUG views, but I have a problem when displaying the images; using the browser element inspector, it just tells me that could not load the image , I'm thinking that the pro...
asked by 05.04.2018 / 01:19
0
answers

How to show a pug plate

Using ajax request the template to the nodejs server. And show it with the head and the body. To replace the previous ones The ajax request is already made. just do not replace the head of a web page already rendered.     
asked by 25.01.2018 / 17:11