Posts by Ruan Martinelli • 268 points
8 posts
-
0
votes1
answer1194
viewsA: Return query result with Node
Why don’t you pass one callback function to the execSQLQuery run with the result instead of passing the object res? Would something like this: app.post('/companies', function(req, res) { // ...…
-
1
votes2
answers6045
viewsA: Delay Javascript
Using the function setInterval you can do it that way too: let i = 0 const timer = setInterval(function() { if (i >= 5) { // aborta a execução caso a condição seja atingida clearInterval(timer) }…
javascriptanswered Ruan Martinelli 268 -
2
votes1
answer202
viewsA: How do I put an app to run in the background when it’s closed?
Just set the event close of the object BrowserWindow so that it hides the application instead of closing it: let win = new BrowserWindow({ width: 380, height: 600, }) win.on('close', event => {…
-
1
votes1
answer230
viewsA: How do I trigger the Cancel event when I click out of the modal or Esc grip?
In Angularui, the property result of the object returned by $uibModal.open is a Promise that solves when the modal is closed using the function $uibModalInstance.close and rejects when the modal is…
-
2
votes1
answer682
viewsA: Modularize Nodejs Connection with Postgresql
In the second code you are already exporting the object that represents the connection. It is not necessary to invoke it as if it were a function. So instead of importing the module this way: var…
-
3
votes3
answers801
viewsA: How to concatenate an object with a variable to be dynamic?
If I understand correctly, you can access the properties of the object using the following notation: var attr = 'name'; var attr2 = 'email'; console.log(user[attr]) // mesmo que "user.name" // =>…
-
0
votes1
answer43
viewsA: Is it possible to visually display another value for a certain value in the bank?
You can create a filter in Angular to display the text you want based on the index you set to the priority: angular .module('nomedoapp') .filter('prioridadeFilter', function() { return…
-
0
votes1
answer36
viewsA: Node assync Function does not return data
Assuming you’re using the express, you need to use the method send to return the data to the customer. app.post('/login',async function(req,res){ email = req.body.username; password =…