Posts by Fernando Zabin • 707 points
28 posts
-
1
votes1
answer1991
viewsQ: Remove Timezone on request with Node.js and express.js
I have a API with node.js and express.js. In the database the fields of the type datetime are saved correctly, but in response to a request GET date fields come with 3 hours more due to time zone.…
-
1
votes1
answer246
viewsQ: Disable checkbox in Recyclerview
Each item of a RecyclerView contains a Checkbox, and when selecting a checkbox would like to disable all other checkboxes. I created a setOnCheckedChangeListener within the onBindViewHolder and I…
-
3
votes1
answer238
viewsQ: Ignore attribute in POST using Retrofit
I would like to know how to ignore a model attribute in a request POST with Retrofit. In requests GET I want to bring all attributes, but in requests POST I need to send the object without the id…
-
0
votes1
answer605
viewsA: Request when returning to previous scene in React-Native
I solved this problem by passing a props to scene A in the Actions.pop() function of scene B, and in scene A I implemented the componentWillReceiveProps() method to make the call in the API if you…
react-nativeanswered Fernando Zabin 707 -
0
votes1
answer605
viewsQ: Request when returning to previous scene in React-Native
I’m using react-native-router-flux for routes and scenes. I got scenes A and B on screen GET in an API in function componentWillMount() and display the information. On screen B I have a form and…
react-nativeasked Fernando Zabin 707 -
3
votes0
answers2629
viewsQ: Background function with React Native
I have two functions, one that takes the current position of geolocation and the other that performs this function in a given period of time. I have a button that I use to initialize and pause this…
-
5
votes2
answers459
viewsQ: Represent relationships in json
What is the right way or best practice to represent the relationships of a json resource? As an example, I have tables contrato, representante and empresa and relationships contract N:1…
jsonasked Fernando Zabin 707 -
0
votes1
answer250
viewsQ: Modeling of parcels and fiscal notes
I have the following tables: CREATE TABLE projeto ( idprojeto int not null, ... ); CREATE TABLE nota_fiscal ( idnota_fiscal int not null, numero int not null, data_emissao datetime not null,…
databaseasked Fernando Zabin 707 -
1
votes1
answer89
viewsA: Take only what was changed on an object
It was much simpler than I thought. I just created a function that compares two objects and returns an object with the changes. function diffBetween(old, cur) { var updated = {}; for (var prop in…
-
2
votes1
answer89
viewsQ: Take only what was changed on an object
I implemented a PATCH function to update the data of a resource, but I need to only take the updated data of an already loaded object on the screen to send in the request. What would be the most…
-
0
votes0
answers90
viewsQ: Post in table N:N with Node.js and Angularjs
I have a relationship N:N and 3 tables: projeto, pagamento and projeto_pagamento. In a form, I want to register a project and 5 payments, which would be the best way to perform this insertion? I…
-
0
votes2
answers169
viewsA: Selects selected from object
I decided to change the ng-options and the list vm.tipos. Stayed like this: HTML: <select class="form-control" name="tipo" ng-model="vm.projeto.tipo" ng-options="tipo.valor as tipo.descricao for…
angularjsanswered Fernando Zabin 707 -
0
votes2
answers169
viewsQ: Selects selected from object
Inputs of type select are not selected when loading a form from an object. The values of select are set in the controller. How do I load the page and select them with the object values? For example,…
angularjsasked Fernando Zabin 707 -
4
votes2
answers548
viewsQ: Navbar scrollbar does not appear on another width
I used the code below to change when the menu button for mobile is displayed and it worked, but the scroll bar does not appear in this size. What can I do to display the scroll bar? If I need to put…
-
4
votes1
answer661
viewsQ: Good practices for changing variables $Scope
Follow an example of code: Controller: $scope.filterText = {status: 'Todos', tipo: 'Todos'}; $scope.params = {page: 1, total: 10, orderBy: 'id', sort: 'desc', search: {status: '',tipo: ''}};…
angularjsasked Fernando Zabin 707 -
1
votes1
answer362
viewsQ: Split the table in two?
I have a table with 25 columns (counting the FK) and two groups of users, one will access only 10 columns and the other will access almost all. Because I thought I had many columns in a single table…
-
2
votes2
answers163
viewsQ: Controller and service logic with Angularjs
I have some questions regarding the logic of the controller and service search functions. Follow an example of service: angular.module("myApp").factory("ProjetosAPI", function ($http, config) { var…
-
3
votes2
answers1032
viewsQ: Bring all records if parameter is different
I have a table contrato with the countryside concluido of the kind tinyint(1), if it is 0 it is not completed and if it is 1 it is completed. I will pass this value per parameter to the query, as I…
-
0
votes1
answer1758
viewsQ: Query parameterized with Node.js and knex.js
In the code below I make a query and bring the contracts that are concluded or not, according to the parameter concluido (0 or 1). How do I bring this consultation all contracts when the parameter…
-
2
votes2
answers637
viewsQ: Time difference between Javascript and Mysql dates
Have data_inicio and data_fim and I want to know the difference of hours and minutes between them. The data_inicio will already be saved in the Mysql database as datetime, data_fim will pick the…
-
3
votes1
answer368
viewsQ: GET function in ng-click
I need to call a function GET through ng-click to popular a table and the function without using service works, but the function using service does not work. Controller: Works…
angularjsasked Fernando Zabin 707 -
2
votes3
answers1003
viewsQ: Pass value to service Factory in Engineering
I need to pass two values (page and total) of $Scope that are in the controller to a Factory service, how do I? Is there any good practice to do this? Service:…
-
1
votes1
answer300
viewsQ: Angular and mysql paging logic
I would like to know how to implement a database paging logic using mysql and angular on the front end with ui-bootstrap or dirPagination. For example, taking 10 out of 10 in the bank using LIMIT…
-
2
votes1
answer262
viewsQ: Access hours and minutes with Angular Timer
I want to take the data of hours and minutes from the Angular Timer and play in a variable to save in the bank, as I do?
angularjsasked Fernando Zabin 707 -
3
votes1
answer1698
viewsQ: Routes in separate files
How do I put routes in separate files? var express = require('express'); var App = express.Router(); var Notas = require('../api/notas'); App.route('/notas') .get(Notas.read) .post(Notas.create);…
-
10
votes2
answers2295
viewsQ: Good Practices for URI in Restful API
I’m having doubts about the Uris of some of the api features I’m developing. I have the features projects and activities in connection with 1-N, that is, a project has several activities and an…
-
4
votes1
answer857
viewsQ: Varchar or int for "type" fields
I have a column guy with 6 options to save in the bank, it is better to save the string as varchar or as int and treat it in front? For example, when it is 1 in the bank, display certain string on…
-
0
votes2
answers393
viewsQ: Routes with Angularjs and Node.js
I learned a little about Angularjs and now I’m starting with Node.js and some doubts have arisen. With Angular I use $routeProvider to create the routes and navigate between the pages as single page…