Posts by mercador • 2,786 points
91 posts
-
0
votes1
answer481
viewsA: @Angular in global and non-local repository for all projects
Yes, you can create a directory node_modules among projects. Of node.js documentation If the module Identifier passed to require() is not a core module, and does not Begin with '/', '../', or './',…
-
1
votes1
answer841
viewsA: How to read the result of a JSON array using Ionic 3?
Your local variable this.data.response is a array, therefore it is necessary to access its first position and then use dot Notation to access the desired property. const response = [ { "nome":…
-
0
votes2
answers745
viewsA: Angular Eventemitter 4 does not work
Use EventEmitter in a service is considered a bad practice. Basically, EventEmitter is an abstraction of framework Angular and its sole purpose is to issue events in components. Angular will never…
-
3
votes1
answer1675
viewsA: How to read data from an excel table in C?
There is the library Libxl, but she gets paid. Example: generate a spreadsheet from scratch #include "libxl.h" int main() { BookHandle book = xlCreateBook(); // xlCreateXMLBook() if(book) {…
-
1
votes2
answers444
viewsA: How to work with Primeng Editor?
According to the documentation Editor provides a default Toolbar with common options, to customize it define your Elements Inside the header element. Translating Editor provides a standard toolbar…
-
2
votes1
answer1179
viewsA: How to work with Fork of a project?
In your local clone of your repository Fork, you can add the original Github repository as remote. remotes are like aliases for repository Urls - for example, origin is one of them. So you can use…
-
1
votes1
answer560
viewsA: Property 'includes' is Missing in type 'Subscription'
Your problem is that you are trying to assign the result of subscribe to his list of Pergunta, when the value is already applied within the first callback. Therefore, make the following…
-
1
votes1
answer1166
viewsA: Circumvent "object property does not exist" error
Cause of the problem According to the section Type-checking the Response of the official documentation of framework: The HttpClient.get() method parse the JSON server Response into the Anonymous…
-
0
votes1
answer68
viewsA: Strange error on Xlworkbook line
Since you did not install the package then you do not have the appropriate Dlls. By not having these Dlls you will get the specified error Type or namespace 'Xlworkbook' could not be found. In…
-
0
votes1
answer917
viewsA: Angular multiple ngif Else passing parameter in template
Sometimes writing in pseudocode helps to clarify the goal: se restricaoSegUm == False && restricaoSalaSegUm == False então mostrar <div class="cursor-pointer"> senao se restricaoSegUm…
-
0
votes1
answer843
viewsA: Sending file via FTP in C#, URI error
How do you want to do the upload of a file, you must provide to Ftpclient the file name. var request = (FtpWebRequest)WebRequest.Create("ftp://127.0.0.1/arquivo.zip"); Source:…
-
4
votes1
answer3615
viewsA: CORS error when requesting using Httpclient at Angular
Considering the documentation of API of Weather Weather, after the token have been generated, just you concatenate it at the end of the URL used for each HTTP request: public get(url: string,…
-
1
votes1
answer216
viewsA: How to concatenate a javascript object to a post form?
According to the function documentation jQuery.param() If the Object passed is in an Array, it must be an array of Objects in the format returned by .serializeArray() Translating if past object is…
-
1
votes1
answer100
viewsA: How do I work with Arrays using Angular 5 in the log console?
Use the function filter listarTodas(): Promise<any> { return this.http.get(this.cidadesUrl) .toPromise() .then(response => { let resultado = response.json(); console.log(resultado.filter(_…
-
2
votes1
answer23
viewsA: For with Datetime in Razor giving out of memory Exception
According to the documentation, the method DateTime.AddDays Returns a new DateTime adding the specified number of days to the value of that instance. Note the emphasis. This method returns the…
-
1
votes1
answer392
viewsA: The element is generated with an attribute and the respective CSS with another attribute
The behavior you are witnessing is due to the fact that framework Angular use Shadow DOM. In short, Shadow DOM is part of the standard Web Components and enables the encapsulation of the DOM tree…
-
2
votes1
answer38
viewsA: Error When Customizing MVC5 Routes
This error means that somewhere, on a Route, you specified something like [Route("AlgumaRota/{algumparametro:string}")] The restriction inline string is not required as it is already the assumed…
-
2
votes3
answers127
viewsA: Make a code that brings values like this(1K, 1M or 2G)
You can do something like this: public static void Main() { long[] numeros = { 1, 10, 100, 1000, 10000, 1000000, 125000, 125900, 1000000, 1250000, 1258000, 10000000, 10500000, 100000000, 100100000,…
-
2
votes2
answers89
viewsA: How to iterate on a model in C# with variables that have number?
Like the Maniero said in his commenting, it is necessary to use reflection to do this. If you are unable to make the modifications he suggested, the following code works and can help you. public…
-
0
votes1
answer636
viewsA: How to filter an Observable?
You want to filter the array and not the observable which envelopes the array. So you should map using the function map the content of observable (which is Pessoa[]) and then yes filter it.…
-
0
votes5
answers1024
viewsA: How to get last position of an ID in the array
You can scroll through each element keeping the last coordinate according to the id, overwriting the last occurrence. This ensures that at the end you will only have the last occurrence of each…
-
1
votes2
answers132
viewsA: Cast Typescript ( ERROR Typeerror )
You can’t just make a cast of a Javascript result from an Ajax request to a Javascript/Typescript class instance. There are several techniques to do this and usually involve copying data. Unless you…
-
3
votes1
answer868
viewsA: Angular Interceptor 5 is not triggered
You cannot modify the body of the request, as it obeys the rule of immutability. From documentation (my translation): Interceptors exist to examine and change outgoing requests and responses…
-
1
votes1
answer2698
viewsA: How to call reading HTTP responses
You can do something like this: saveUsuario(usuario: Usuario): Observable<Usuario> { return this.http.post(this.apiUrl, usuario) .catch((error: any) => { return Observable.throw(error); });…
-
4
votes2
answers59
viewsA: Fetch values in an object
Yes, using the function reduce const base = { misc: { first: 'look', level: { move: 'handler' } }, words: { page: { index: { nav: 'rule', aside: { bottom: 'awesome' } } } } } $('.btn ').on('click',…
-
0
votes2
answers31
viewsA: Validate campus by calling javascript function
You need to use the external resource Vanillamasker <script src="https://cdnjs.cloudflare.com/ajax/libs/vanilla-masker/1.1.0/vanilla-masker.min.js"></script>…
-
0
votes1
answer53
viewsA: How to pass a value to a list and make it static?
A list of reference types is nothing more than a list of references. This means that each position in the list keeps a reference to the object inserted there. Why does this happen? var obj = new…
-
1
votes1
answer628
viewsA: I’m not getting to use a module
Within the NgModule.imports, you can list only modules, not components: imports: [ BrowserModule, AppRoutingModule, FormsModule, ReactiveFormsModule, HttpModule, NgbModule.forRoot(),…
-
1
votes1
answer129
viewsA: Object created within conditional If generates c++ build error
You are trying to use the variable a outside its scope. The scope of a local variable is only between opening brackets { and closure } of a block, starting in its statement from. if(nivel == 1){…
-
1
votes1
answer150
viewsA: How to assign the return of Strtok to an array of strings?
According to C Standard Library documentation, Section 7.1.4 (translation made by me) Each of the following statements applies unless it is explicitly stated otherwise in the detailed descriptions…
-
1
votes1
answer239
viewsA: How to create structure vector within function
Considering the chunk of code that uses a vector of structures, I have the following observations. typedef struct mercearia { ... } mercearia; After that definition of type, mercearia can be used as…
-
5
votes2
answers196
viewsA: Javascript - Mathematical module of a value
From what I understand you want the module representation in a number. See Math.abs() console.log(Math.abs(10)); console.log(Math.abs(-10));…
-
0
votes1
answer42
viewsA: Javascript - It is possible to have a universal ordering function
It is possible. You can use the bracket notation together with the parameter funcaoDeComparacao for the method sort(), where you should set the comparison function by accessing the object property…
-
3
votes2
answers4622
viewsA: What command using *ngIf to do a larger and smaller check
You must use the logical operator && <p *ngIf="resultado.MediaTotal > 50 && resultado.MediaTotal < 70" style="color:green"> {{resultado.MediaTotal} </p>…
-
0
votes3
answers79
viewsA: C# doubling value alone
As mentioned in the comment, we failed to add the following line before assigning the value to the variable b dado = Console.ReadLine(); b = float.Parse(dado); ...…
-
3
votes1
answer104
viewsA: Why can’t I get a read on that Cyborg?
The function scanf automatically consumes blanks, prior to conversion, from the standard input stream stdin when the conversion specifier is not one of the following: %c, %n and %[]. This means that…
-
1
votes2
answers932
viewsA: How to pass a large list of objects to API in C#?
You can modify the element httpRuntime in the archive web config. adding the following attribute. This should solve the problem of the object having null value when executing the POST. // limite…
-
0
votes1
answer757
viewsA: ERROR Error: Uncaught (in Promise): Typeerror: Cannot read Property 'src' of null
As you are trying to access an element based on your id, you could use the Decorator angular ViewChild instead of using pure Javascript. sombraFase1.html <ion-content class="bgcSombra"…
-
0
votes2
answers70
viewsA: Undefined Reference to `Teste_1::Teste_1
Before the class definition Teste_1 in the header file Test_1.h, include the library string: #ifndef TESTE_1_H_INCLUDED #define TESTE_1_H_INCLUDED #include <string> class Teste_1 { ... After…
-
6
votes2
answers5966
viewsA: What are the differences between npm and Yarn?
Some points that I consider important. Determinism In the Node ecosystem, dependencies are placed inside a directory called node_modules in your project. However, this file structure may differ from…
-
2
votes1
answer143
viewsA: Error sending files via Java Socket
Is there any process on your machine listening at the door 5656. Whereas you are using Windows: netstat -ano | find "5656" lists the listening process at the door 5656. Then use taskkill -pid "pid…
-
11
votes3
answers172
viewsA: What is the difference in the 3 types of variables and how do they behave in the compiler?
static int valor1 = 10 / 5; // Declaração de um campo. static int valor2() => 10 / 5; // Declaração de um método estático utilizando membro de expressâo incorporada. static int valor3 => 10 /…
-
4
votes1
answer169
viewsA: removeAttr('required') obsolete?
According to the page of warnings jQuery Migrate 3.0 plugin+ JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties Cause: Before jQuery 3.0, the use of .removeAttr() in an attribute…
-
5
votes1
answer1604
viewsA: Access array in Json
Use the bracket notation. Moreover, image is a array: data.artist.image[3]['#text'] Click on View code snippet and then in Execute to see working: var json = { "data":{ "artist":{ "name":"Madeon",…
javascriptanswered mercador 2,786 -
4
votes1
answer1152
viewsA: Sending complex objects via Httpget
To parameter binding Web API works as follows: If the parameter is a simple type, the Web API tries to get the URI value. Simple types include. NET primitive types (int, bool, double and so on), in…
-
4
votes2
answers3915
viewsA: ERROR Typeerror: Cannot read Property 'push' of null
The array items is being initialized with null, so an exception is generated when .push() is called. It is necessary to initialize items with a array empty, so items will be defined: items:…
-
6
votes2
answers252
viewsA: Apply immutability effect to objects in a Javascript class ECMA6
Documentation of the method Object.freeze() says, among other things, that (emphasis added): Note what values they are objects yet may be modified, the less than they also are frozen. How to make an…
-
1
votes3
answers756
viewsA: Transform a Json Array into another JSON using Node
Start by creating a map and then transform to the desired format. var objeto = [ { "numDoc":"0000001", "OutrosCampos":"outrosDados", "itens":[ { "itemNum":"000000001", "nome":"AAAAAAAAA",…
-
7
votes1
answer359
viewsA: Overwritten txt file in C
Just open the file with fopen in the way append: FILE *file = fopen("meuarquivo.txt", "a");…
-
0
votes2
answers333
viewsA: Default Value Dropdown Angularjs
whereas only one object within the array cfops will have the property default with the value true, you can inject $filter in your controller and use the first position returned by this function (I…