Posts by celsomtrindade • 8,038 points
240 posts
-
0
votes2
answers125
viewsQ: Mysql load the last purchase of each item
I can a list of technical sheets of some products where I need to make the cost calculation taking into account only the last purchases made of each item of a technical sheet. For example, to make a…
mysqlasked celsomtrindade 8,038 -
0
votes2
answers917
viewsA: Angular 7 - Add a datatables to the component
You have an import error involving dtOptions. Can’t bind to 'dtOptions' Since it isn’t a know Property of 'table'. Unable to apply dtOptions as it is not a known table property'. Check that the…
-
7
votes4
answers3943
viewsA: Calculate mail freight for various products
After some time reading much online material and researching thoroughly on the subject, I think I managed to arrive at a satisfactory result. As already discussed here (and also a question…
-
1
votes1
answer65
viewsA: Request for angular token
I believe your problem is happening because you are caring http module (@angular/http) while the Headers comes from another module (@angular/common/http). By Angular team indication (due to future…
-
1
votes1
answer1356
viewsA: How to create components in Angular?
This happens because your ChildComponent (app-layout-cadastro-estilo) is trying to access a property declared on ParentComponent (app-estilo-cadastro), that would be the form. One of the methods of…
angularanswered celsomtrindade 8,038 -
0
votes2
answers1034
viewsA: Measure distance from multiple points using Google
It’s been a while since I worked with this kind of calculation, but when I did, I used the Google Distance Matrix. With it you can define some metrics to make this calculation, as the mode of…
-
4
votes2
answers3047
viewsA: How to insert HTML within an Angular 4 Component?
You must create a variable to receive the values within the Component. See this example: @Component({ selector: 'app-button', template: ` <button type="submit">{{label}}</button> `, })…
angularanswered celsomtrindade 8,038 -
1
votes1
answer389
viewsA: Disable Validators.Required Angular2
You can use the method setValidators, thus: // Para utilizar uma validação this.formulario.controls.CodigoTemp.setValidators([ Validators.required, ]); // Para remover as validações…
-
1
votes3
answers4262
viewsQ: How do I get the difference between dates on business days in Mysql?
I would like to know if it is possible to calculate the difference between 2 dates by counting working days. In that reply there is even a solution, but from what I saw, the check is only for…
mysqlasked celsomtrindade 8,038 -
1
votes3
answers2143
viewsA: How to center an img within a div, both responsive, without losing responsiveness?
You can use another technique, with already very comprehensive support, which would be the Object-fit. This will greatly simplify your code. div { height: 200px; width: 400px; border: 1px solid…
-
4
votes1
answer68
viewsA: Checklist: with CSS only
What you are doing is selecting the odd and even items (Odd and Even) with the code nth-of-type(). What you should do is provide the "calculation" to select from 2 in 2 elements. For this, use the…
-
18
votes4
answers3943
viewsQ: Calculate mail freight for various products
I am trying to make the freight calculation of various products using the Webservice of the post office, but I am having doubts/difficulty to perform the calculation when I have several products. I…
-
1
votes2
answers289
viewsA: Redirect with . htaccess if url contains string
I don’t possess very advanced knowledge in .htaccess, but I managed to resolve the issue by changing only 2 lines. I removed RewriteRule ^index.html$ - [L] and I moved this part RewriteBase / to the…
-
0
votes1
answer91
viewsA: Manage errors in HTTP calls
I was able to "solve" the problem using the following code: // No início do código, para retornar status 500 em qualquer erro não esperado. ini_set('display_errors', 0); // Antes de retornar uma…
-
0
votes2
answers289
viewsQ: Redirect with . htaccess if url contains string
I am working on an application using Angular4 and PHP, for the Angular URL to work, I need to use a certain configuration in .htaccess to direct to the index.html, thus: <IfModule…
-
1
votes1
answer91
viewsQ: Manage errors in HTTP calls
I am working on an application with Angular(4+) and PHP and I have some questions about the HTTP calls made to the server and how to better manage the cases where the function returns with error. I…
-
1
votes2
answers2463
viewsQ: Mysql select multiple columns from the same table with conditions
I need to select some data from a single table depending on the type of user, for example, a Personal user will have the field RG and PIS while a user will have the field State registration and…
-
3
votes2
answers2154
viewsA: How do I convert a date into American format in Angular?
As discussed in the comments, and also as an alternative response, we can use a module to improve the work with dates in Angularjs. Would be the module Angular-Moment. It has several benefits, such…
-
2
votes1
answer49
viewsA: Would it be interesting guidelines using http.get?
It will depend on your context, but generally not, because every time the directive is rendered, it will execute the call $http. Often the information does not change constantly so that we need to…
-
0
votes2
answers1062
viewsA: What does the data-reactid attribute mean?
It belongs to the Framework React and is automatically added by the Framework itself to identify some component in order to perform some updating and/or manipulation of content. This method,…
-
1
votes2
answers580
viewsA: How do you use align-self?
The estate align-self is used in an item that is descended from an element with display: flex;. As the translated name suggests, it serves for "Auto-alignment", i.e., it will align only the item and…
-
0
votes4
answers1662
viewsA: Comparing and updating data from an HTML table with data returned via JSON?
One way that can simplify enough for you is the use of angular.merge(), that causes 2 lists to be unified into one, updating the values of the common properties. That is, with each request you make,…
angularjsanswered celsomtrindade 8,038 -
1
votes1
answer2264
viewsA: Reactjs - How to run AJAX calls?
Despite recommendations regarding the use of the method fetch, I have chosen to use another AJAX call service due to compatibility and use of promise. The service I’m using is the Xios which was…
-
1
votes1
answer676
viewsA: How to sort across multiple fields with Ionic and/or Angularjs from a JSON?
With Angular, first of all, I recommend that you DO NOT use sorting (or any other type of filter) through the filter, especially within a ngRepeat, the impact on performance is really great when…
-
0
votes1
answer46
viewsA: Calling Service from a then() resulting from another service
How you are utilizing a service of the type service you must return the functions with the declaration this to be accessed in this way: example.service('PessoasService', [function () { var…
angularjsanswered celsomtrindade 8,038 -
1
votes1
answer2264
viewsQ: Reactjs - How to run AJAX calls?
I’m developing a project in React (first time I’m working with React) and I’m having doubts at the time of running calls to the server, be a GET or POST. I even managed to perform this task, but in…
-
7
votes2
answers6208
viewsA: How do I keep my footer down?
One of the main reasons I don’t like using this technique is because it involves the position: absolute, which does not work in the case of a dynamic (responsive) website as it depends on the…
-
0
votes3
answers990
viewsA: Show data with Angularjs according to an input type="select"
What you need to do is use the same ngModel, so much on the input as in the select, thus: <select name="funcionario" id="funcionario" class="form-control" ng-model="funcionarioSelecionado"…
-
9
votes3
answers4539
viewsQ: Force client-side update after site update
The scenario of my problem is this, I have a website that has been updated, but some customers are reporting that the update was not made for them, which are still in the old model of the site…
-
3
votes2
answers146
viewsA: Calling database data with $http get
First your variable definition is incorrect, try it this way: var showCat = function() {... Another thing would be your data processing on the PHP side. You are doing something very complex to…
-
1
votes2
answers1001
viewsA: Data in ng-Model with input date shows error in Angularjs
The date format you need to pass to input recognises how a valid date format should be: YYYY-MM-DD //ano-mes-dia Therefore, you must format the date before assigning to the field.…
angularjsanswered celsomtrindade 8,038 -
0
votes2
answers439
viewsA: Angularjs - POST an array of objects (JSON data) to the php page
As you commented that your error is in PHP, it is probably by way of receiving the data. Try to use the following: $post = json_decode(file_get_contents("php://input")); $data =…
-
9
votes3
answers1408
viewsA: What are the differences between the forms of dependency injection?
Just an alternative answer, providing a 4th method (which is what I use), so you have more alternatives. Wallace’s answer is perfect, you should keep in mind that if you’re going to run code…
angularjsanswered celsomtrindade 8,038 -
1
votes1
answer228
viewsA: Send link by Phpmailer
If you are using inside a <a></a>, for example, you must be sure that enabled the mode html. That means he will process your code html and print everything correctly. To do this, just…
-
1
votes1
answer820
viewsA: PDO Insert multiple lines into a single Insert using bindParam
Based on the rray comment, I was able to elaborate a function that gives me the desired result. By using bindParam it creates the reference based on the value of a variable, so when updating the…
-
3
votes1
answer820
viewsQ: PDO Insert multiple lines into a single Insert using bindParam
I have a default function that I use for all of my Inserts (when they only have 1 Insert at a time), which would be: insereRegistro($sql, $param=NULL) { $query = $conn->prepare($sql); //Converte…
-
2
votes0
answers449
viewsQ: Permission and user levels in PHP and Angularjs (JS)
I am developing an administrative panel where I have some users and these should have different permissions levels. At the same time, it must be something "dynamic" for there to be control of basic…
-
1
votes0
answers364
viewsQ: SQL Select inside a select with condition
I have 3 tables in the database to control a "news portal", where the tables have the following functions: news -> Table with the news gallery -> Table with images used in news relation ->…
-
2
votes1
answer118
viewsA: How to recover php parameters passed by the $http({ ... data: ...?
When you get a response from $http, you receive together 5 parameters: data, status, headers, config, statusText. What you want, or what has the data itself, is the date. Therefore your receipt…
-
0
votes2
answers560
viewsQ: Save reports to a table or run a database query?
I am setting up an e-commerce where I have an area to generate sales reports. These reports are divided by year and month. Currently I have a query sql where segment the results by year and month…
-
3
votes3
answers1003
viewsA: Pass value to service Factory in Engineering
As discussed in the comments, although there is already an accepted answer, it shows only one way to update a given in Factory. Another method, and perhaps one of the best Angularjs tools, is to…
-
4
votes4
answers11110
viewsQ: How to group SQL results by month and year?
I would like to know how I can query the Mysql database and group the records by year and month. At the moment I first make a query to get the year records, then for each year I use a for() to…
-
4
votes2
answers729
viewsQ: PHP json_encode with Boolean and decimal values
I have a PHP function that takes data from the database and returns an array with the results. This array by default has all the data as type string, but some fields should be treated as Boolean…
-
1
votes3
answers1544
viewsA: HTTP post in Angular
I recently went through the same problem while trying to get data from an external API that blocked my requests with the same error as yours. What I did to solve the problem was to create a…
-
1
votes0
answers295
viewsQ: Using "in" (or "rem") unit for responsive layouts
Reading some CSS articles on responsive layout I managed to understand some new "concepts", but some applications were still a bit confusing for me, which is the case of the use of em (or rem) to…
-
3
votes1
answer829
viewsQ: PHP class vs Function
When and why should I wear one class instead of a function simple in PHP? For example, I have a function that performs the insertion of a history in the database, which is a function common to many…
phpasked celsomtrindade 8,038 -
1
votes1
answer516
viewsA: Problem passing parameters through the url using Angularjs
You should first declare that the url expects a parameter, thus: url: '/produto:idProduto', //ou /produto/:idProduto Then you pass this parameter by the link as an object, like this:…
-
0
votes1
answer146
viewsA: Error injecting $state into controller
The problem is you’re doing the injection of $state in the configuration file, which is not allowed. Remove it by leaving your line like this: routerApp.config(function($stateProvider,…
angularjsanswered celsomtrindade 8,038 -
4
votes2
answers3309
viewsQ: Check if difference between dates is greater than X minutes in PHP
First of all, I’ve done a lot of research here on the site and I haven’t found any more in-depth examples, just basic questions/answers on how to get the difference between dates, what I was able to…
phpasked celsomtrindade 8,038 -
1
votes1
answer51
viewsA: Display which directives are being used on the page
There are two options (which I know): Add console.log manually; Angularjs Batarang - Extension for Chrome; With the use of the console, it is very simple and straightforward, just add one at the…