Posts by Lucas Brogni • 1,012 points
68 posts
-
1
votes1
answer39
viewsA: Listing all categories with total number of products
select count(PRO.pro_nome), CAT.cat_nome from categorias CAT INNER JOIN produtos PRO ON CAT.cat_codigo=PRO.pro_codigo_categoria group by CAT.cat_nome Will list the quantity of products for each…
-
0
votes3
answers65
viewsA: Object for Array php
Patrick, if you don’t have to be in PHP the transformation to array, you can do it as follows. Where I set the value to x, it would be in the case of your server’s sponse. let x = { "ESPUMANTES": […
phpanswered Lucas Brogni 1,012 -
0
votes2
answers188
viewsA: Percentage javascript or php
To calculate the Profit you can do so. In the call of this function pass the value of Cost and the desired profit percentage. function calculaValor(valorCusto, percentualLucro){ return (valorCusto +…
phpanswered Lucas Brogni 1,012 -
0
votes2
answers1515
viewsA: Cross-origin requests are being blocked
Add the Cors: npm install cors --save In Node js add this code const cors = require('cors'); app.use(cors());
-
0
votes1
answer80
viewsA: How to put a successful Alert into a data insertion via ajax?
var qtdRegistros = dados.length; var contador = 0; success: (function(data) { contador++; if (contador == dados.length) alert('Mensagem'); }); Implement a counter and compare if the entered records…
-
1
votes3
answers1529
viewsA: What technologies can I use to create a PWA
You can use for example the Ionic to create your PWA and use any WEB programming language to create a Rest API in the back end. With Angular you will be able to integrate with native cellular…
-
1
votes2
answers307
viewsA: How to make the angular recognize an ng-keyup event created dynamically in the element
You can use jquery to catch by placing the code below inside ngOnInit() import * as $ from 'jquery'; ngOnInit(){ $(document).keyup(function(r){ /* Fazer ação */ }) }…
-
1
votes2
answers2225
viewsA: How to take the sum of an entire column in SQLSERVER
You can do something about it Select sum(a.VOL) from ( *SUA QUERY AQUI*) a
-
0
votes1
answer45
viewsA: Converting data into Javascript
I believe that what you want would not be with an array itself, but with an object... for example you could do.: var objeto = { nomeUsuario: 'Bruno'} //Atribui Bruno para a a propriedade nomeUsuario…
javascriptanswered Lucas Brogni 1,012 -
0
votes1
answer203
viewsA: Object as parameters for C#API
I was able to accomplish what I wanted. However I stopped using GET and started sending via POST. Because in GET we have no way to send a body.
-
1
votes1
answer203
viewsQ: Object as parameters for C#API
I have a request made in Angular for C#. However I don’t know how to receive the data in My API In C#. getWithFilters(filter: any) { let parametros: any = { razaoSocial: filter.razaoSocial, cnpj:…
-
1
votes2
answers8087
viewsA: Consuming API with javascript/jquery
$.ajax({ type: 'GET', url: suaUrlAqui success: function(data) { // O que pretende fazer aqui. //ex: var pessoa = JSON.parse(data); document.getElementById("CPF").value= pessoa.pessoa[0].CPF; } });…
-
0
votes1
answer79
viewsA: Sort date on grid chronologically?
I made an example of how your rule should be with another lib. [dayjs] - Follow the link if you want to check it. const dayjs = require('dayjs'); let x = [ { data: dayjs(new…
-
0
votes3
answers14857
viewsA: How to validate Cpf with javascript mask?
You can let the guy type in the numbers without putting in the dots and then replace it with the code below. function replaceCPF(cpf){ return cpf.replace(/^(\d{3})(\d{3})(\d{3})(\d{2})/,…
-
0
votes2
answers552
viewsA: Custom input component
Failed to inform formControlName. <input *ngIf='input.control == "input"' class="{{input.css}}" type="{{input.type}}" formControlName='{{ input.formControlName }}' />…
-
0
votes2
answers33
viewsA: Introducing formulas in the web application
Try to do something more or less like that. <div id="inputs"> </div> <script> let z = document.createElement("INPUT"); z.setAttribute("type", "text"); z.setAttribute("name", "t1");…
-
1
votes5
answers3268
viewsA: Make lamp light on and off
You can make a code similar to mine to change the lamp image. <script> var atual_state = 'DESLIGADA'; function mudaEstado() { atual_state === 'DESLIGADA' ? atual_state = 'LIGADA' : atual_state…
javascriptanswered Lucas Brogni 1,012 -
0
votes2
answers1133
viewsA: How to login validation in Angular?
Try to map the answer. this._authService.getUser(this._user) .map( res => res.json()) //map .subscribe( res => { if( this._authService.userIsAuthenticated() === false ){ this.userAuthenticated…