Posts by Marcos Filipe • 89 points
6 posts
-
0
votes1
answer31
viewsA: Reuse Angular Service Code
A solution (if you really want to use a "generic" service) would be to create a service as follows: @Injectable({ providedIn: 'root' }) export class CRUDService { private ws: string…
-
1
votes1
answer155
viewsA: Doubt with Nested Observables (Angular 8 & Ionic 4)
Really the problem is because the methods are asynchronous. A possible solution would be as follows: contaQuantidadeCadaProduto() { const produtos: [{ id: number, quantidade: number }] = [];…
-
1
votes1
answer510
viewsA: How to give "Trigger" in an Option of a Mat-select that is already selected?
Well, first of all I don’t know why you want to select something that has already been selected XD but come on... (If I understood your question) A simple solution to your problem would be to link…
-
1
votes1
answer579
viewsA: Listing an array within an angular JSON
Try this way: <div *ngIf="game"> <h3>{{game.name}}</h3> <p><img src="https://images.igdb.com/igdb/image/upload/t_cover_big/{{game.cover.image_id}}.jpg">…
-
1
votes1
answer558
viewsA: I need to export a variable from one typescript to another, but the variable does not get the value I need
You can use this variable as a observable so you can access the variable value anywhere in the application. Provide these variable access and value exchange methods via a service. first create the…
-
1
votes1
answer318
viewsA: Disconnect users or authenticate them again if the server is restarted - Angular 2
There are N possible solutions to this type of problem. I will demonstrate how I do this in my applications. A request to the server (using httpClient from common angular) as follows:…