Posts by Matheus Franco • 492 points
19 posts
-
0
votes2
answers492
viewsA: How do I format the text typed in the input without changing the value?
To insert the commas: function addCommas(event) { event.value = event.value.replace(/\D/g, '') .replace(/\B(?=(\d{3})+(?!\d))/g, ','); } To add up the values later: function…
-
2
votes1
answer152
viewsA: How to call a pure java script function when unchecked and marked a checkbox?
First let’s add a tag to show the result: <strong id="total">0</strong> Now let’s go to javascript: var checkboxes = document.querySelector('#opc1')…
-
3
votes1
answer636
viewsA: JS - Cannot read Property 'value' of null
The problem is time to take the element by ID. The program is not finding any ID with the name "#user" or "#password". As he did not find, he returned null. And since null has no function or…
-
3
votes2
answers379
viewsA: A simple question using % in JS
The name of the symbol % is percentage or percentage. It represents the module or mod between two integers. We use this symbol to know the rest of the division between two values. If it is 0, that…
-
1
votes1
answer32
viewsA: Problem with Javascript code resetting after including CSS
The problem is in the button. The button by default is Submit. This is used when the result appears on another page or when sending data by post/get. As in your case the result is on the same page…
-
1
votes2
answers812
viewsA: Abbreviate names with javascript
If I understand correctly, this must be it. Follows the code: console.log(abridgedControl('Sabrina Boing Moreira', 13)); //Sabrina B. M. function abridgedControl(fullName, limit) { if…
-
0
votes1
answer110
viewsA: How to change the array order? Discord.js
Using the function re-verse javascript: messages .array() .reverse() .map(msg => console.log(`${msg.author.tag}: ${msg.content}`)); Observing: To var arr is not being read anywhere and is within…
javascriptanswered Matheus Franco 492 -
0
votes1
answer44
viewsA: Cancel subscribe
Try to use the take(1). It would look something like this: this._bookingsService.getByUserAndStatus(this.user._id, this.statusSelect) .pipe(take(1)) .subscribe(resp => ... );…
-
1
votes1
answer120
viewsA: Javascript array problem
Look, I’m not sure what you want to do, but there are two possibilities that I’ve imagined. Preserve the content of chartContent and use the function val. But it should preserve the variable type as…
-
1
votes2
answers70
viewsA: Add Input value as a Select Option
You need to enter the value in the tag with the innerHTML and add the tag with the appendchild. Follows the correction: function addName() { let selectMenu = document.querySelector('.mySelect'); let…
-
0
votes2
answers48
viewsA: Subtraction between 2 fields
The id="Tg" is in the tag td and not in the tag input. But it’s better to do the variable calculation instead of the innerHTML calculation. Follow the corrected code: function calcular() { var g1 =…
javascriptanswered Matheus Franco 492 -
0
votes1
answer207
viewsA: Correct method to display/hide interface according to profiles/rules/credentials with Angular 2+
Yes, with the async pipe. Instead of signing to the observable, insert it directly into the HTML. In HTML: <ng-template *ngIf="check$ | async"> <ng-content></ng-content>…
-
0
votes1
answer306
viewsA: Problems with this.router.navigate
You need to configure the routes in your route module. In the module: { path: 'edit/:valor', component: SeuComponent, }, In TS: this.router.navigate(['edit', valor], { relativeTo: this.route.parent…
-
0
votes1
answer323
viewsA: Paginator does not work when it has two tables in angular material
The Viewchild of paginatorABV and paginatorCFG are referencing the same Matpaginator. When it is so, it is better to name the tags by id. In HTML it would look like this: <mat-paginator…
angularanswered Matheus Franco 492 -
0
votes2
answers190
viewsA: Pass property to the Angular System
You can use both of the form of @Input, as in the form of ng-content. Component call: <app-top-bar>Agendamento</app-top-bar> Within the component: <ion-title>…
-
6
votes1
answer503
viewsA: Example of use - angle mask
The Ngxmask is an interesting library for masks. Installation: npm install --save ngx-Mask When importing your module: NgxMaskModule.forRoot() Your component would look like this: <mat-form-field…
-
0
votes2
answers104
viewsA: Time for shutdown, or immediate shutdown?
I believe that the best thing is a deactivation and not deletion. So the user can activate his account at any time. Another thing you’re having in large systems, like the Gmail itself that was…
uxanswered Matheus Franco 492 -
0
votes2
answers407
viewsA: When I put input inside some div javascript does not work
Two things I could see: Inputs are spaced between the "< input" opening tag. You should log this space. Since you want to put the effect for any input within the form in question, you should…
-
6
votes2
answers4697
viewsA: Eclipse UTF8 configuration
Path in the Eclipse: Window > Preferences > Type "Encoding". Switch all the points you think you need to UTF-8.