Posts by Marcelo Vismari • 1,665 points
78 posts
-
2
votes2
answers262
viewsA: How to pass props to the state in React
If the idea is to read the attribute value Just use the button event.target.value: handleClick(){ const valBotaoClicado = event.target.value; this.setState({ result: valBotaoClicado }) }…
reactanswered Marcelo Vismari 1,665 -
1
votes1
answer551
viewsA: How to use checkbox with ngFor?
Juan, by clicking on the checkbox change the value of a variable and make your <p> use this variable to be displayed or not: <input type="checkbox" (change)="minhaVariavel =…
-
2
votes1
answer100
viewsA: What does the word "of" mean in Rxjs?
As @LINQ commented, the creation operator of converts the arguments into an observable sequence: // RxJS v6+ import { of } from 'rxjs'; //emits any number of provided values in sequence const source…
rxjsanswered Marcelo Vismari 1,665 -
0
votes1
answer131
viewsA: Dynamic search with Javascript and JSON
Two adjustments: Add the command $('#saidaTxt').html(''); in the first line of the function listaItens On the line var saida = array(); adjustment to var saida = Array();…
javascriptanswered Marcelo Vismari 1,665 -
0
votes1
answer224
viewsA: Reactjs - How to call the state from an input to another Class
Luis, depending on where the checkbox and the button are, I’ll explain... If both belong to the same component you can control the disabled through a status variable. See a simple example:…
-
0
votes1
answer46
viewsA: Send text by Routes (Children)
Add information exactly like title: // (...) path: '/', component: MyPageComponent, data: { title: 'Meu titulo', outraInfo: 'teste' } // (...) Example of how to read title and outraInfo: // (...)…
-
3
votes2
answers343
viewsA: Input with CPF/ CNPJ mask undergoing change by keys like TAB and ENTER
According to your code, every time the user type '999999.999-99' and press TAB, as the event is activated on keydown the length is equal to 11 and so your code executes the content within the else.…
-
0
votes2
answers312
viewsA: Regex catch value between two words
Maybe there’s another way but I was able to think of the following expression: TOTAL[\n]+([0-9.,]+)[\n]+DEDUÇÕES: const reg = /^TOTAL[\n]+([0-9.,]+)[\n]+DEDUÇÕES$/gm; const input = `TOTAL 62.715,90…
regexanswered Marcelo Vismari 1,665 -
1
votes1
answer342
viewsA: Select is not initialized with default value
Arthur, from what I understand, when the field item_id of your template being populated means that an item must be selected by default in your combo. If so, bind [value] in your select. See a…
-
1
votes2
answers59
viewsA: Run task only when CTRL and mouse are pressed
One possibility is to add an event on document to check when the ctrl is pressed and released. In these moments you can enable/disable the input. Note: to test the example below using the button…
javascriptanswered Marcelo Vismari 1,665 -
4
votes2
answers3244
viewsA: Multipart Formdata is a data structure?
The multipart/form-data represents a type of content that will be submitted to the server in the same way as a application/json. The difference is the source of the request. If it has its origin in…
answered Marcelo Vismari 1,665 -
1
votes1
answer223
viewsA: How to get information from a tr in HTML code using Htmlagilitypack from Visual Studio
Marcelo, I set an example here for you to read the td but you will need to make some negotiations that are commented in the code below: HtmlAgilityPack.HtmlDocument htmlDoc = new…
-
1
votes1
answer435
viewsA: Select option makes the Input field mandatory
You can add an event to the form to intercept Submit and apply a validation. It’s a very simple and fast option: const form = document.querySelector('#myForm'); form.addEventListener('submit',…
-
2
votes1
answer91
viewsA: Save data from an offline input
The value of the input was saved in localStorage but you are not reading and filling your input with this value when your component is initialized. Example: nome : string; nome1: string; ngOnInit()…
-
1
votes1
answer285
viewsA: How to edit an existing localStorage item in a blob url
When your script starts to be interpreted it saves a value in the localStorage, builds the function newBlob and exchange the href passing the function result newBlob. By replacing the href It’s like…
javascriptanswered Marcelo Vismari 1,665 -
2
votes1
answer50
viewsA: Error when adding class to a node element
In addition to the error quoted by @Augusto (missing . in the querySelctorAll) in the comments, you will have a problem with the variable i within your for. When you click under one div.job-card the…
javascriptanswered Marcelo Vismari 1,665 -
2
votes2
answers4009
viewsA: How to upload an image to the backend
Since you are using React, I imagine you will make an Ajax request to move the image to the API. To do this in Javascript use FormData as the excerpt below illustrates: <form method="post"…
-
2
votes2
answers302
viewsA: Counter reset every time reset
Paulo, check that the timer has reached zero and then assign a new value to target_date. This way whenever the timer zeroes will be assigned a new timer of x days more: // (...) var segundos_f =…
-
0
votes1
answer253
viewsA: Add parameters dynamically in a Javascript function
as I do not know the context of your project I just changed a little its code to pass the parameters in a generic way, as you mentioned. Basically for each item the Array objs i search the…
-
2
votes1
answer295
viewsA: Drag and drop with Angular CDK - Keep items in position after page refresh
Matheus, as a suggestion, instead of changing the .style.transform use the property cdkDragFreeDragPosition. See the example below: import {Component, OnInit, ViewChild, ElementRef} from…
-
1
votes1
answer693
viewsA: Send the contents of a front-end function via POST to Node
Luis below is a complete example where a form with a single field is posted on a given route: Filing cabinet server.js: const express = require('express'); const path = require('path'); const app =…
-
6
votes1
answer66
viewsA: Why when the page loads the event is triggered?
Diogo, the second parameter of the method addEventListener expects a function that will be executed every time the event is triggered. By passing only the alert('ola mundo') this excerpt is…
-
0
votes1
answer42
viewsA: My code only filters if you type first letter Jquery, how to filter by typing the whole word (table)?
Some information is missing to give a more concrete answer but I hope the example below can help you: $('#myInput').keyup(function () { const val = event.target.value.toUpperCase(); $('#table…
-
1
votes1
answer37
viewsA: Angular route direct to folder with Wordpress
How do you have a route mapped to /home when you apply the redirect this route is called within the Angular context. You can create a component and use window.localion.href= to return to your root…
angularanswered Marcelo Vismari 1,665 -
0
votes2
answers1704
viewsA: How to send request in Timestamp: yyyyMMddHHmmssffff format using Postman?
To get to the format you need it is possible to use only the methods of Date as the example below shows: const a = new Date(); const yyyy = a.getFullYear(); const MM = (a.getMonth() +…
-
2
votes2
answers763
viewsA: Async/Await x Sync
But if I have to wait for the answer, why use async with await, being that if I use the method without the async I also hope an answer? I believe this is not your question but responding to the…
-
0
votes3
answers588
viewsA: Return of request status code
When the server returns an error, such as 500, an exception of the Webexception type is thrown. Then to get the error code use a Try/catch. Example: using System; using System.Net; public class…
-
1
votes2
answers307
viewsA: Search(Json + Javascript)
Short answer: it is possible to consume Webservices using only HTML/JS/CSS taking into account some points. Assuming you only have a few HTML/JS/CSS files, I assume your application is composed of…