Posts by ruansenadev • 423 points
30 posts
-
0
votes1
answer212
viewsA: Angular 8 - reactive form Directive and disabled attribute
This error is shown in Development mode, to warn about inconsistency in the app’s operation. You must have started the form group without setting the disabled, i.e. false, and in the same lifecycle…
-
0
votes3
answers171
viewsA: Trying to manipulate a JSON with JS
The problem is in assigning the recording variable, when the loop leaves the contents blank in the array... If the goal is to delete the last character is very simple, change the following lines:…
-
9
votes1
answer941
viewsQ: What is the difference between Object.assign and spread Operator?
What is the detailed difference of using Object.assign and the Operator spread (...) for spreading properties of objects? For example, when editing an object for new values, it is the same output:…
-
0
votes2
answers59
viewsA: With CSS is there any way to put opacity in the currentColor?
Css is not Javascript, if you call the function var(--cor) will be returned, only and only the value of the --color property. Then logically no conversion of --cor: #FF0000 for a spread of 255, 0,…
-
3
votes2
answers48
viewsA: What am I doing wrong in this exercise?
the value of the transaction in the case anos >= 0 && anos < 1 is a Boolean. your switch is comparing with 7 === true or 7 === false. For conditions use the If <script> function…
javascriptanswered ruansenadev 423 -
1
votes1
answer78
viewsA: Add javascript countdown to localstorage
To save to localStorage you need the key to be a Domstring, but you do not have access to all keys you need your program to remember the key, your alternative is to map in a object or array and…
-
0
votes2
answers441
viewsA: Outdated branch pull request in Git
If you have merged the branch in the master you need to revert to the master to follow the next steps.. git reset --hard origin/master After that you can safely pull back on master to stay up to…
-
2
votes1
answer366
viewsA: Operating a delete operator needs to be optional
Simple, because if you remove the property of an interface that is not optional, as the error is, the user interface would no longer be a user interface because lint understands that you would need…
-
1
votes3
answers179
viewsA: Using a Class within another CSS Class
Browser and even less HTML won’t process this for you for security. the easiest way would be using a view-engine, if not a preprocessor. Apparently you cannot use them, to make this change then you…
-
0
votes1
answer52
viewsA: Content-Security-Policy + Angular 8
So Angular can apply dynamic styles to the elements in the keyword style-src you must complement with 'unsafe-inline' <meta http-equiv="Content-Security-Policy" content="script-src 'self';…
angularanswered ruansenadev 423 -
0
votes3
answers229
viewsA: Angular HTTP subscribe does not return Sponse
Obervables are like a stream of data that emits events, so to get the data from these events you need to subscribe to the stream, the object returned from this stream is a subscriber (which is the…
-
0
votes3
answers133
viewsA: Create multiple dynamic Lis columns with flex-Direction: column; leaving the first child with width proportional to the number of columns
The best way for you to determine the relative size of the flex item without changing the calculation and flow of the others is with flex-Basis. The flex-Basis relates to flex-direction, if the…
-
1
votes1
answer115
viewsA: How to properly align an item gallery with flexbox?
Use an internal wrapper, .container { display: flex; justify-content: center; width: 100%; } .container-inner { display: flex; flex-wrap: wrap; justify-content: flex-start; width: calc(146px * 3) }…
-
1
votes2
answers83
viewsA: Problem when deleting item in a json file
Wait for the asynchronous recording of the data and only then close the request, otherwise the express won’t be able to write the headers properly. fs.writeFile("./data/dados.json",…
-
0
votes1
answer208
viewsA: Dynamically load page contents
If the search is done on the same page you just need to wait for the result to load await page.waitFor(5000) // espera por 5 segundos and continue scraping the page :) await page.evaluate(() => {…
-
0
votes1
answer308
viewsA: Error importing Sass module into Angular
Searching the github I found a Issue solved, apparently the webpack of Sass Loader is importing the files _index.scss of mdc as index.js and there are 2 solutions for now: Set the path node_modules…
-
-2
votes1
answer308
viewsQ: Error importing Sass module into Angular
I want to use MDC Image List but when importing in style . scss from some Angular module @use "@material/image-list/mdc-image-list"; does not compile with following error: Module build failed (from…
-
1
votes3
answers98
viewsA: Why is the expression ``` == '`' true?
Not just the string template (`\`` === '`') && ('\`' === '`') also results in the same, since the backslash function is for encoding special characteres or some sequence like \n b, and `…
-
0
votes2
answers64
viewsA: How to redirect to another page, using the query that went to the previous page?
There is no way you can do any operation by the server after the res have been sent. The solution is only by the same browser <script> setTimeout(() => { location.href =…
-
1
votes1
answer187
viewsA: Loop countdown script
There is no way the program knows the next date that the counter must repeat, so you must create a function that calculates the date in a distance of time and then reset at the end of the Interval…
javascriptanswered ruansenadev 423 -
1
votes2
answers184
viewsA: How to make a window.scrollTo(0.0) without animation
Call the function with value of scrollOptions window.scrollTo({top: 0, left: 0, behavior: 'auto'}); The compatibility of js Options Object and Behavior css is the same…
-
0
votes1
answer40
viewsA: I’m doing a project with Node.JS and Puppeteer, I need him to click the Dialog Box
The event is of the class Dialog await project.page.on('dialog', dialog => { dialog.accept(); });…
-
1
votes1
answer39
viewsA: Is giving javascript conflict
Turns out you’re wearing one Globalevent of window Object, and you associate it with one function and soon after the changes to another. Then logically it will only execute the value that is in it…
-
1
votes1
answer146
viewsA: Angular Integration with Delphi
By default browsers do not accept that your site receives data from another source other than the same origin, CORS means (Resources from cross origins), for security reasons is disabled. So what…
-
0
votes2
answers32
viewsA: for in loop resuming the "length" index of a nodlist, is that normal? any tips to solve this?
Use a for simple that you have control of the content for (let iBox = 0; i < boxSlider.length; iBox++) { let boxMain = boxSlider[iBox]; // ... }…
javascriptanswered ruansenadev 423 -
2
votes1
answer20
viewsA: Elements <td> in a new row when reaching a certain quantity
You forget to tuck it into the table when it is created, and the count also goes wrong on account of the operator > which only returns true when there are already 1, so correct is < 11 or ==…
javascriptanswered ruansenadev 423 -
2
votes1
answer41
viewsA: How to wait for the previous function to create the component on the screen and then take the data from that component (javascript)
If you are making a request it is necessary to wait for the server response to perform the other operations since they need this data, so Synchronous, and you’ve done it with the .ajax() and the…
-
2
votes1
answer102
viewsA: Insert HTTP does not work Cannot read Property 'id' of Undefined
From the Express ^4.16.0 body-parser is already available in the framework with the methods urlencoded and json, just configure in app.js app.use(express.json()) app.use(express.urlencoded({…
-
1
votes2
answers52
viewsA: Hide/Display a div
On the call of one is celular.classList and in another celulares.classList, a little confusion in the variables.. function mostrarcelulares() { // celular.classList.remove("escondido");…
-
1
votes1
answer53
viewsA: javascrip for burger menu
Good as your hamburger is contained in an anchor </a>, you must first cancel the redirect event: let menuButton = document.querySelector(".menuButton"); let menu =…
javascriptanswered ruansenadev 423