Posts by OnoSendai • 36,218 points
614 posts
-
1
votes2
answers434
viewsA: Routes at Angular 1.6
Your version needs some minor fixes before it works. $routePriveder appears to be a typo ($routeProvider) HomeController is specified in the route declaration, but is never stated. Solution:…
-
5
votes4
answers1662
viewsA: Comparing and updating data from an HTML table with data returned via JSON?
Preserve the returned values in a mapped object, whose property key is the position of the paper in the array papeis. Next, change only the value of the property according to the return of the API.…
-
1
votes2
answers74
viewsA: Angularjs - request Does not pass parameter
You’re passing the literal string 'dataTableLoad' to the server. I imagine you want to pass the value of dataTableLoad. Try it like this: $http({ method: 'POST', url: '../assets/php/client/PHP.php',…
-
0
votes1
answer358
viewsA: ngRoute does not work
You are configuring Angular to use HTML5 mode: $locationProvider.html5Mode(true); You then need to set the value of base in the header of your page - for example: <head> <base href="/">…
-
2
votes2
answers1323
viewsA: Sort items with angular
All items that are not appearing have the values of the first and third columns equal: ["3","Dohkinho","3","[email protected]","Administradores","SIM"],…
-
1
votes2
answers202
viewsA: How to work with the file:// and Angular protocol
Simple answer: You can’t. The protocol file:// has several restrictions imposed by the browser. However nothing prevents you from creating a web service on your machine, and offer a local site…
-
3
votes2
answers837
viewsA: How to generate UUID’s/GUID’s with Javascript?
Versions based on crypto.getRandomValues() can ensure a lower crash rate than Math.random(). function uuid() { // Retorna um número randômico entre 0 e 15. function randomDigit() { // Se o browser…
-
5
votes3
answers447
viewsA: Prevent cookies from being viewed/obtained with javascript
[...] what are cookies that "are not accessed by javascript"? Are cookies created with the marker HttpOnly, which should be matched with the marker Secure. For example:…
-
5
votes4
answers760
viewsA: What are Path Finding Algorithms?
What Are Path Finding Algorithms? They are algorithms that propose to solve the minimum path problem. What types exist? Of wikipedia article: Algorithm by Dijkstra - Solves the problem with a source…
-
1
votes2
answers1517
viewsA: String count in textarea Angularjs
There is no need for external components. However you need to expand the default behavior of ng-model, since it does not propagate the properties of the element, maxlength among them:…
-
14
votes1
answer1015
viewsA: Calculations used to rotate an image on canvas
Why in A, canvas needs to have the same image dimensions? This action creates a buffer - a temporary workspace - the same size as the target image. Why in B, canvas needs to have Translate values…
-
2
votes5
answers721
viewsA: Element with different end size than width and height definition in CSS?
Because when inspecting the div that is in the code by the browser it is with height:202px and widht:402px and not width:300px; and height:100px;? This occurs because of the standard area…
-
1
votes1
answer77
viewsA: Session staying open when I close the browser
I think the model you chose (one session per user) generates a very high cost of control for a very small benefit value. You’re basically fighting the multi-device identity paradigm. Given the very…
-
9
votes3
answers572
viewsA: What is map / reduce?
map(fn (elemento)) It is used to perform a transformation on all items of a array. Similar to the forEach(), with the difference that the callback of map() should always return a value - and this…
javascriptanswered OnoSendai 36,218 -
2
votes4
answers874
viewsA: Manipulating JS odds when using Math.Random()?
The algorithm below is composed of two parts: numTipo is generated: its value shall be 0 if the return of a random generation from 1 to 10 is greater than 8, or 1 negative case; and numFinal simply…
-
24
votes3
answers4443
viewsA: What are the main differences between Angular, React and Vue.js?
Topical Angular Vue.js React Popularity rank 2 N/A 4 Appreciation 6 N/A 1 Number of posts (OS) 226.473 5,288 37.731 Operating model MVC View View Category Framework1 Library Library 1 A framework is…
-
6
votes1
answer208
viewsA: Problems using $state.go of the angular
Your control initialization is incomplete, and because of this the reference to $state is with the value NULL. You are using the declaration format of providers in array, however only 3 of the 6 of…
-
2
votes1
answer852
viewsA: Angular JS routes
Modify modulo.config(function($routeProvider){ $routeProvider for modulo.config(function($routeProvider, $locationProvider) { $locationProvider.hashPrefix(''); $routeProvider Your mistake is for a…
-
0
votes1
answer173
viewsA: Error using a view for two controllers
I created a variable in the named controller $rootScope.buttonCtrl Nop, you have created a variable in the root scope ($rootScope). Two problems: This scope does not belong to the controller (the…
-
1
votes1
answer66
viewsA: Limit text to the first paragraph in Angularjs
use an Angular blend with CSS. In the example below, $scope.compacto controls the view mode. ng-class="{'compact': compacto}" makes the css class compact is added to the element if the value of…
-
0
votes1
answer56
viewsA: How to "Delete Participant" without having to refresh (F5) the page?
You are performing the treatment of the event in the following excerpt: PessoaEventoService.excluirPessoaEvento(data) .then(function(dados){ // Tratamento de retorno toaster.pop({ type: 'success',…
-
0
votes1
answer154
viewsA: Angular - keep tabs created when updating the page
You need to preserve the collection $scope.tabs. In the following example you can notice that the collection receives a new member each click on the button Add Tab. I changed the code of your…
-
20
votes4
answers26195
viewsA: What is a payload?
In general terms, the payload ("cargo" is the content sent by a means of transport, or Carrier. Some examples: The content HTML is the payload sent via protocol HTTP; The content JSON is the payload…
-
1
votes2
answers65
viewsA: Listing information with select
Two small typing errors. In the controller, where it reads bairro.seleciona = bairro.opcoes[0]; should be read bairro.selecionado = bairro.opcoes[0]; In the view, where it reads…
-
2
votes3
answers156
viewsA: Exit the loop suddenly
Your biggest problem is that... var i; for(i=0;i<=coisas.length;i++){ FazAlgoTrabalhoso(coisas[i].algo1, coisas[i].algo2, coisas[i].algo3); } ...is a process synchronous, which means that…
-
1
votes1
answer710
viewsA: ng-repeat angular
Your question is not very clear, and it would be much better if you could show an example of the content of $scope.registros and $scope.data. Still, follows a simplified example of visualization:…
-
1
votes2
answers286
viewsA: Use of the REST question mark
If you really want to follow the specification REST, a request GET no parameters for the endpoint shall result in the return of all records. meuservidor/buscar Will result in the full list. Let’s…
-
5
votes1
answer1162
viewsA: Deploy App Node.js on localhost(Production)
If your application uses Node + Angular, one possibility is to generate an executable via Electron. It already comes with built-in Node.js. However, you can use npm and npm packages generate…
-
2
votes2
answers850
viewsA: How to load a value in select
You can make use of chained Promises: $http.get('https://fipe-parallelum.rhcloud.com/api/v1/carros/marcas') .then(function(data) { $scope.marcas = data; return…
-
2
votes3
answers1104
viewsA: How to create a property of an object dynamically?
Confirm that $item owns a property name. Dynamic creation of computed properties works perfectly on most modern browsers: // Computed property names (ES2015) function AddSelectOption(name, item) {…
-
2
votes2
answers154
viewsA: How to simplify Hexadecimal code #ff6a00
TL;DR: There’s no way to simplify. Long version: In long hexadecimal notation this is not possible, since it is the original format used in the question (#RRGGBB). In short hexadecimal notation…
-
2
votes3
answers588
viewsA: How do I redirect the user to the address they are visiting after logging in?
Implement URL storage in your process. Example: While the user browses through public states without needing Sign-in, intercept the current URL and store it in session or local Storage. User…
-
2
votes2
answers277
viewsA: What is this error that appears on the console, rotating angular?
You’re trying to use $urlRouterProvider without the service startup mention. Change the line var app = angular.module('weset', []); for var app = angular.module('weset', ['ui.router']); // Adiciona…
-
2
votes3
answers66689
viewsA: How do I activate IIS in windows 10?
I had a similar personal experience. On a newly booted Windows 10 machine with some installed tools (Antivirus among them) the installation of IIS never came to an end. The cause was linked to…
-
6
votes2
answers68
viewsA: How can I indicate the directory where my assemblies should be found?
As @Maniero mentioned, use the key probing in his web config. or app config. if its value is static. If it changes programmatically, you can use System.Reflection.Assembly.LoadFrom() to load an…
-
4
votes1
answer312
viewsA: How to avoid multiple function calls in the view?
Why not run directly in the view ? In the example below a bind in the view is used to: Filter the collection items, removing all marked items: Use the resulting collection and count the number of…
-
1
votes2
answers128
viewsA: Difficulty accessing url with angular post
You are probably running this file without a local server using the protocol file:\\. Additionally, in the excerpt: $http.post("localhost:8765/api/v1/[...] Angular is trying to infer the protocol…
-
41
votes6
answers6389
viewsA: What is a legacy code?
So said the Master Programmer: Let the programmers be many and the managers few - then everyone will be productive. Legend has it that in a remote province there was a monastery where the Master…
-
0
votes1
answer552
viewsA: Access controller function by directive
Use a callback (in Portuguese, callback). In your directive, define a scope property that will receive the callback of controller: app.directive('exemploDiretiva', function () { return { restrict:…
-
4
votes3
answers1079
viewsA: Problem checking all checkboxes
A purely Angular solution (without jQuery): angular.module('myApp', []) .controller('myController', function($scope){ $scope.selected = {}; $scope.items = ['Item 1','Item 2','Item 3','Item 4'];…
-
1
votes2
answers2054
viewsA: How to increment the counter with ng-repeat?
There is no need to perform such an operation just for a line counter, as ng-repeat provides an automatically - $index: angular.module('myApp', []) .controller('myController', function($scope){…
-
0
votes2
answers242
viewsA: Circular http dependency found: $http <- Authservice <- Authinterceptor <- $http <- $templateRequest <- $route'
Authservice has a method, login(), which is not used in any part of the code. It is also the only section that uses the previous $http. Solution: Remove, from AuthService, the injection of service…
-
3
votes1
answer87
viewsA: HTTPS on Rest architecture
Yes, you can use the same certificate, provided that: Using a domain certificate (*.dominio.com.br), which is generally not recommended for safety reasons, or A certificate with list of multiple…
-
7
votes2
answers1770
views -
2
votes1
answer447
viewsA: Returning HTML to an API would be good practice? Microservice?
Should the API return HTML? This is good practice? And why wouldn’t it be? If you are speaking explicitly about REST Apis, the answer is probably nay because you wouldn’t be returning objects in…
-
2
votes2
answers637
viewsA: Insert array within an angular scope
On the line: $scope.apostas = [ { timeApostado: time, partidaApostada: partidaA, cotacaoApostada: cotacaoA, idDaPartida: idpart } ]; You are setting the property value apostas of $scope with an…
-
4
votes1
answer291
viewsA: Why do some angular services use dollar ("$") at the beginning?
In some circumstances Angular ignores variables prefixed with the signal $ (dollar, or dollar Sign): Json filters do not generate output content; When using the directive {{}} Angular will not show…
-
1
votes2
answers80
viewsA: How to fit all content on the screen? Edge at the bottom of the page does not appear in the viewer or browser
Add box-sizing: border-box; to your external container, #containerGeral. From the box-Sizing property documentation: The CSS box-Sizing property is used to change the default property of the box…
-
6
votes4
answers763
viewsA: What would be a good way to apply events: onMouseOver and onMouseOut, for all img tags?
Basic Javascript solution, no jQuery: // Obtenha todos os elementos do tipo <img> var elems = document.getElementsByTagName("img"); // Cicle por todos os elementos obtidos, for (var i = 0; i…
-
5
votes2
answers951
viewsA: Site in dynamic HTML
I am a beginner developer and I make static websites in HTML/CSS. You then have experience with one aspect of the developer profile front-end - that handles the part of the application that is…