Posts by OnoSendai • 36,218 points
614 posts
-
1
votes1
answer217
viewsA: Controllers in includes Angularjs 1
The controller remains instantiated but invisible, as the test below can prove: angular.module('myApp', []) .controller('paiCtrl', function($scope){ $scope.targetUrl = null; }).controller('aCtrl',…
-
0
votes4
answers3995
viewsA: How to make a link button in Angularjs
Vanilla Via Javascript <input type="button" onclick="location.href='http://servidor.com.br';" value="Visitar servidor.com.br" /> Via form action <form action="http://servidor.com.br">…
-
2
votes1
answer959
viewsA: How I list the Packages in the oracle
To list all Packages: SELECT object_name FROM user_objects WHERE object_type = 'PACKAGE'; To check if a specific package exists: SELECT object_name FROM user_objects WHERE object_type = 'PACKAGE'…
-
4
votes1
answer262
viewsA: Access hours and minutes with Angular Timer
Interrupt the Timer with a broadcast: $scope.$broadcast('timer-stop'); At the same time, monitor the event timer-stopped, and capture the object containing the timer state:…
-
2
votes2
answers514
viewsA: How to return a pure Json (without XML encapsulation) using webservice in c#
So that the attribute ScriptMethod be interpreted, you need to ensure that the module System.Web.Extensions be loaded. Two amendments to the sitting system.web in his web.config are necessary:…
-
5
votes2
answers111
viewsA: Why is the last letter of my code replaced by a question mark "?"?
Your encryption routine is working, as this example on dotNETFiddle can demonstrate: https://dotnetfiddle.net/WIouyV using System; public class Program { public static void Main() { string sPalavra,…
-
2
votes2
answers844
viewsA: How can I filter, both by Category and by Price?
Correct me if I’m wrong, but it seems to me you want ordering and not filtering. The following example uses data obtained from the URL mentioned in the code to perform two-field sorting based on…
-
4
votes3
answers88
viewsA: Insert non-existent months into the array
Method 1: To make it work var mesVendaArray = [{4:3094}, {6:9873}, {7:6531}, {12:10937}]; for (m = 1; m < 12; m++) { // Para todos os meses possíveis, var found = false;…
-
3
votes2
answers3456
viewsA: How to get parameters in the URL through Angularjs
Use the service $location. For example, for a given URL http://example.com/#/some/path?foo=bar&baz=xoxo: var abUl = $location.absUrl(); // =>…
-
1
votes3
answers216
viewsA: Why is the behavior of the undefined variable different from the undefined property?
An undeclared variable is not listed in Variableenvironment. In his example: console.log(preco) That means the identifier preco is not solved for any object stored in VariableEnvironment; an…
-
3
votes1
answer194
viewsA: Return Json - Angularjs
Your second example JSON is invalid. Use a parser like the http://json.parser.online.fr/ to test it. The two patterns in use are as follows:: Estate: {"chave": "valor"} Collection: ["valor1",…
-
2
votes2
answers417
viewsA: "Cannot read Property" after an http.get request
This happens because the object returned in callback has several properties. The one that interests you is data, which contains the body of the returned response. Change your code as follows:…
-
5
votes1
answer191
viewsA: Format json output by separating in commas
Yes, it is possible via Regex: console.log("0102030405".match(/.{1,2}/g)); Will generate the following output: [ "01", "02", "03", "04", "05" ] The parameter {1,N} specifies capture of size groups…
javascriptanswered OnoSendai 36,218 -
4
votes1
answer67
viewsA: How to write this java program using javascript and Node?
Javascript has no threads. However you can run asynchronous methods. Example below: var x = 0; var y = 0; function sum() { x = y + 1; y = x + 1; } function main() { for (i = 1; i <= 10; i++) {…
-
2
votes1
answer438
viewsA: Storing multiple values of an Enum in the database
Modify your flags to match bits, thus allowing boolean operations: [Flags] public enum DiaDaSemana { Domingo = 1, // 0x00000001 Segunda = 2, // 0x00000010 Terca = 4, // 0x00000100 Quarta = 8, //…
-
29
votes2
answers3637
viewsA: The first programming language
How could anyone write an Assembly code when there was no text editor or anything? The answer is a bit long, but it will be worth it. Let’s take the opportunity to clear some concepts: Any and all…
-
1
votes1
answer977
viewsA: Cannot find module 'reflect-Metadata'
NPM should be updated to v3. Previous versions will cause this error. To update your version: npm install npm -g Reference.…
-
3
votes1
answer381
viewsA: How to set variable in Angular Scope JS
Assign the selected value to a scope variable indicating a model property, via ng-model. The following example stores the selection in the property $scope.casa.rua (assuming that $scope.casa is a…
-
6
votes3
answers3825
viewsA: Limit for sending files
There are two settings to be modified. maxRequestLength indicates the maximum size of an upload supported by ASP.NET maxAllowedContentLength specifies the maximum content size of a request supported…
-
3
votes2
answers228
viewsA: Where to store the information?
It depends on how you want to model your application: In your browser - You can write a completely client-side solution, keeping user data in the instance of browser. To do so, use the Web Storage…
-
7
votes3
answers1083
viewsA: How can I create a filter to fill with zero left at the angle?
Implementation as Filter: .filter('numberFixedLen', function () { return function (n, len) { var num = parseInt(n, 10); len = parseInt(len, 10); if (isNaN(num) || isNaN(len)) { return n; } num =…
-
1
votes1
answer254
viewsA: Access Function declared in the Directive controller by transcluded objects
You can create an object to bridge between the scopes of the controller and of Directive; The content transported will thus have access to the methods implemented by the Directive. Functional…
-
4
votes1
answer865
viewsA: How to use natural language processing in Portuguese with C#?
You can find pre-trained templates of various languages (including English) for Opennlp 1.5 at the following link: http://opennlp.sourceforge.net/models-1.5/…
-
2
votes1
answer3463
viewsA: Angularjs Error: [$injector:unpr] Unknown Provider:
A provider is only available in the configuration cycle: var module = angular.module('MainModule', ['ui.filters', 'ngRoute']); module.config(function($routeProvider) { // Ciclo de configuração…
-
13
votes4
answers2450
viewsA: What is the :: (two-point double) in Angularjs?
The term is called one-time Binding. From the Angular documentation: An expression that begins with :: is considered a single execution expression. These expressions are evaluated until their value…
-
2
votes1
answer118
viewsA: View - Single Page Application
By definition any framework SPA deals only with the aspect V of the solution (as frontend-based). Some internally implement MVC/MVVM/MV* to coordinate internal processes - for example Angularjs is…
-
4
votes2
answers615
viewsA: Error page in Angularjs
If you are using angular-ui/ui-router, the provider $urlRouter offers the possibility of configuring the fallback during the stage config - that is used whenever the user tries to access a route not…
-
3
votes3
answers2578
viewsA: Pass Token by header to each Angularjs request
Use a Interceptor to insert the bearer token in all your requests. The following implementation uses localstorage for storage. app.factory('BearerAuthInterceptor', function ($window, $q) { return {…
-
8
votes2
answers9412
viewsA: Is it possible to make an INSERT INTO SELECT + other values outside of SELECT?
You can use static values. Assuming, for example, that the user has ID 1024: INSERT INTO TABELA (ID, NOME, ENDERECO, USUARIO, DATAHORA) SELECT A.ID, A.NOME, A.ENDERECO, 1024, Now() FROM…
-
15
votes7
answers21016
viewsA: What does the term Fallback mean?
Fallback (contingency, in free translation) is an option to be used if the preferred option is not available. The role of fallback is to increase the reliability and availability of systems. When it…
terminologyanswered OnoSendai 36,218 -
4
votes3
answers620
viewsA: How to print the amount of words in a string that gets a sentence in . NET?
Split and a method of strings that transforms the string original in a array, using a character as a cut parameter'. So, you just need to know the total size of the array resulting - this will be…
-
2
votes2
answers843
viewsA: Insert into HTML and with Angularjs functions
You need to compile HTML so that it is recognized by Angular. Example: //HomeCtrl.js module.exports = function($scope, $compile) { // Create Note $scope.create = function(e) { var value =…
-
8
votes4
answers187
viewsA: How to not lose the "this" of the current object
There’s nothing unexpected in your code. this is pointing, correctly, to the context of the object that invoked the method where this was used. Your stack is as follows: new ObjectTest1() <-…
javascriptanswered OnoSendai 36,218 -
4
votes2
answers2116
viewsA: Real-time Google Maps Update
Keep a reference to Marker created and reuse it by updating the position via method setPosition() of that instance. Example below: angular.module('myApp', []). directive('myMap', function($timeout)…
-
3
votes2
answers107
viewsA: How to use template in directives with restrict M (comments)?
A comment cannot have child elements. However, you can compile the resulting element from the controller after the comment itself: angular.module('example', []) .directive('stackoverflow', function…
-
1
votes1
answer994
viewsA: Integration (Angularjs) with Random Sentence API
This is because the.forismatic.com api server requires CORS, or that you use JSONP. The functional example below is an implementation of the second type: var app = angular .module("exemplo", [])…
-
13
votes4
answers15337
viewsA: Security - What is a KEY API?
API Keys are access credentials provided in order to authorize the use of specific API features. There are several types of implementations. Web Applications: Keys API can be provided as JSON Web…
-
1
votes2
answers35
viewsA: Run code before starting services - Angularjs
You can implement a Interceptor exclusively for the service $http, and manipulate headers directly. module.factory('sessionInjector', ['SessionService', function(SessionService) { var…
-
1
votes1
answer507
viewsA: How to Format Each HTML Tag with Its Attributes in Assorted Colors?
The name of this post-processing type is mark-up, or code marking. There are several libraries available to perform this type of marking for you. One of the most used is called hljs (Highlight.js).…
-
5
votes3
answers481
viewsA: How to make preventDefault links at the angle?
Remove href='#' add the following CSS class: a[ng-click]{ cursor: pointer; } Thus you will eliminate the default behavior while maintaining visual link feedback.…
-
3
votes1
answer35
viewsA: Webapi Project - . NET
For this layer I must create a new project? Not necessarily. For example, in a similar project I have a structure where I store my ORM classes in a printer called model, my API endpoints in…
-
2
votes1
answer786
viewsA: Create list sorted by letter with Angularjs
A simple grouping function in vanilla JS can solve your problem. In the following implementation example an object (grp) is created, containing the following structure: { "A": [ "Academia",…
-
2
votes2
answers387
viewsA: Angular $timeout or Javascript timeout?
$timeout automatically runs $scope.$apply() after the execution of callback, thus propagating any change in the model made by callback. $timeout also provides, as a callback, a Promise.…
-
4
votes2
answers57
viewsA: How to display the sum of an X value where you have the same name?
Use the native function reduce() to perform sum per grouping. Example below: var json = [ {"nome":"Coisa A", qtd:2}, {"nome":"Coisa A", qtd:3}, {"nome":"Coisa B", qtd:5}, {"nome":"Coisa B", qtd:7}…
-
11
votes2
answers5258
viewsA: How to redirect http to https
Rewriterule is no longer recommended according to Apache documentation. For the same effect, the recommended method is redirect: <VirtualHost *:80> ServerName www.site.com Redirect /…
-
6
votes3
answers314
viewsA: Cross-Domain Application Security Questions
Use encryption and authentication via customer certificates in a mechanism known as mutual authentication [1]. Create an SSL certificate server-side self-signed and install on your web server. You…
-
3
votes1
answer3127
viewsA: Call another controller function at the angle
If you are consuming the same data source from multiple places in your application it might be worth implementing your source as a service or Factory, as indicated in the Gabriel: .factory(…
-
4
votes1
answer87
viewsA: How to enable cookies in Electron
The environment redenderer Electron does not currently have support for the API document.cookie. Thus, libraries like Google Analytics or similar that use customer-side cookies will not work because…
-
6
votes1
answer258
views -
3
votes2
answers738
viewsA: Paging with Angularjs and Webapi
You have some possibilities. Full Data, Angular Paging: Your endpoint will return the complete data collection. Excellent method for small collections, bad for large. Server paging, page request via…