Most voted "typescript" questions
Typescript is a super superset of Javascript created by Microsoft that adds optional types, classes, interfaces and modules and compiles for pure Javascript.
Learn more…1,167 questions
Sort by count of
-
1
votes1
answer120
viewsAngular 6+: Page update goes to the application’s login area
I performed the composition of my Canactivate and Canload, through the Loggedinguard class. The problem is that whenever I refresh the page, I am redirected to the Login page, even logged in. Below…
-
1
votes1
answer304
viewsTimer with active session time: Cookie expiration time - autal moment
I am working with Angular and, when I store the access token in a cookie, I also save (in another cookie) its expiration time (30 minutes). I want to make a timer that shows the user how long he…
-
1
votes0
answers100
viewsSave result from Firebase and Ionic calculation
I’m trying to save a result from a simple sum in Firebase but I can’t recover the value and insert it. Where I’m missing? Home.html <ion-content padding class="content"> <form…
-
1
votes1
answer106
viewsIonic Directive for numerical masking is not accessed from other pages
I created a project with Ionic with two pages: Login and registration. The structure is this In both I tried to add a directive that creates a mask for CNPJ. Follows code of the directive import {…
-
1
votes0
answers29
viewsHow to set an array of pages in a function and return to a variable, NAVCTRL IONIC
I’m making an application in which the app component has a side menu that uses a Let to fetch the array of pages, however I cannot access them from my previous, not getting the return. //I want to…
-
1
votes1
answer82
viewsHow to declare an extended type in Typescript
Hello, I have the following situation: // essa classe contém apenas 2 propriedades interface Foo { a: string; b: number; } // em determinada situação, eu preciso declarar // a interface junto com…
typescriptasked 5 years, 5 months ago LeandroLuk 4,989 -
1
votes2
answers97
viewsUse updatemany in Mongoose in a request
I’m trying to make a update/Insert with the Mongoosis when finalizing a request. This request returns to me, for example: let obj = [ {nome: aaa,idade: 10}, {nome: bbb,idade: 11}, {nome: ccc,idade:…
-
1
votes0
answers245
viewsPre-select first element of the array
My select <ion-item> <ion-label floating color="primary" interface="popover">Opções de Parcelamento</ion-label> <ion-icon name="pricetags"></ion-icon> <ion-select…
-
1
votes1
answer50
viewsngModel is showing the wrong input values
I have an ngFor that runs through an array Products. Inside this array has the field: value_venda_current, I am trying to make a *ngFor to go through this array and show an input for each product,…
-
1
votes2
answers416
viewsHow to make multiple http requests at angular?
I need to make an http request for each element of my product array. I tried to do with for() but sometimes it doesn’t work, my browser stops working and it costs to close (I thought it could be…
-
1
votes1
answer628
viewsFilter *ngFor async data
As a filter is applied to a *ngFor async, the *ngFor array comes from an Observable. lotes$: Observable<Lote[]>; *ngFor="let lote of (lotes$ | lancamentosFilter:searchText) | async; let i =…
-
1
votes1
answer35
viewsIonic loop reading sensor and sending to api
Hello, I need to take consecutive readings of some sensors in Ionic 3.x but I can’t let it completely block the application. tried to do so: async disparaLeituras(path_id) { while (true) {…
-
1
votes1
answer177
viewsIs there any way to use html tags in an interpolation?
I have a component that calls a confirmation dialog, I pass to the dialog the title and the description of the dialog in this way: const dialogRef = this.dialog.open(ModalConfirmacaoGeral, { data:…
-
1
votes1
answer1083
viewsAngular 7 Router appears the page I want but does not remove the previous page and is both at the same time
I set my files all correctly I think, but when I click on the button This is the router configuration page I put the signup in the array app-route.module.ts import { NgModule } from '@angular/core';…
-
1
votes2
answers332
viewsProblems with Angular 6 script import
I have a small problem with script and I believe it is scope of Component. I use a script to scroll in firefox, because in Chrome works normally anchorScrolling. The problem is that if I call on the…
-
1
votes0
answers57
viewsHow to track the scroll event of an element (not the window) using a directive in Angular (v2+)
Hello, I’m creating a screen with this structure: <div class="wrapper"> <div class="appbar"> ... </div> <div class="main" #main> <router-outlet></router-outlet>…
-
1
votes2
answers581
viewsAngular 7 / Typescript error: Property 'result' does not exist on type 'Element'
I have a function that runs while performing the upload of files, however I am having an error in result within the function onload. This mistake makes no sense because if I give one console.log in…
-
1
votes0
answers77
viewsValidation multi-company mysql relationship
Problem: a company can associate records that are not hers, just informing the id in the relationship Setting: My API is multi-company and each company manages its records (products, orders ...),…
-
1
votes0
answers81
viewsSave dice and then play in BD
I have a code where I show the days of the week, so for each day of the week I have 3 shares: 1 - a select with options; 2 - a button that opens a modal to place an observation; 3 - an input…
-
1
votes3
answers1339
viewsAngular 7: pass the service from one component to another per parameter
I’d like to pass a service as a parameter between two components, from father to son. The communication between the components is okay, I am receiving the service, but when I try to use the…
-
1
votes1
answer747
viewsInterceptor not triggered - Angular 7
I created an Interceptor so that it sends the API access token in the request header, but when performing the http call it is not triggered. Follows the implementations: auth.interceptor.ts: import…
-
1
votes2
answers48
viewsHow to create a new object containing all the values of an initial object but adding new attributes in C#
Hello, I have a question regarding C# and the optimization of the form of code generation. In Typescript, if I have the code below I can create a new object from a previous one and, in the creation…
-
1
votes0
answers79
viewscreate and write with Cordova file Ionic plugin
I am trying to write to a file using the Cordova file, as I cannot write straight to the Assets (which is read-only), I move the file and try to write, but it falls in the catch erro2.…
-
1
votes0
answers33
viewsIonic - Condition in which if the field already exists it will be added again
I have a question on Ionic, I’m trying to do that if the field that would be the zip code is already in the table it will automatically fill the rest with what has already been typed in this zip…
-
1
votes0
answers980
viewsHow to take or manipulate data inside subscribe - Angular
Unfortunately I can’t, even inside the subscribe, scroll through the variable fixtures$ I can send the data to html and show in the table. However I need to manipulate the data to save in the bank…
-
1
votes1
answer112
viewsFor object in typescript, how to get the object name?
I am running a repeat structure to check which fields of my form are invalid. I need to get the name of the first field that is invalid. I tried something like: for(var campoObrigatorio in…
-
1
votes0
answers151
viewsHow to access a method in a Javascript Function at the angle?
I am using a plugin in Jquery and it works very well in Angular, however I want to call a service method within a function of an alert, follows below the code: click event that creates the modal…
-
1
votes1
answer296
viewsTurn Date into String and Format to DD/MM/YYYY using Typing
To send a request to the server, I need to format the parameter dataNascization so that it goes in DD/MM/YYYY format. Right now I’m sending him like this : Request URL:…
-
1
votes1
answer1220
viewsAngular 7 - Change the checkbox color after checking as checked
I have the following checkbox list: I’m wearing Bootstrap 4 and Angular 7. I would like to know a way that when the checkbox is clicked, its line changes color, so it is easier for the user to know…
-
1
votes1
answer849
viewsHow to create an object dynamically from an interface?
I have the following interface: interface IInterface { Method1: (param1: any) => any; Method2: (param2: string[]) => any; } I wish that from it I could create objects dynamically that…
typescriptasked 5 years, 2 months ago Francisco 7,472 -
1
votes1
answer51
viewsDelete key if all values are empty
I have an array of Javascript objects and wanted to check if certain keys/columns have the value "" (empty). If you delete this key from my Javascript object array, otherwise keep it the same.…
-
1
votes1
answer314
viewsAngular 7 - Compare Lists
I have two lists in my component. listPermissoesOfUser: UsuarioPermissoes[]; listAnotherPermissoes: UsuarioPermissoes[]; And when I upload the page, I display them in a primeNG picklist (Two…
-
1
votes1
answer642
viewsError PATH Android Ionic Cordova
Well, I have installed Ionic in the new version, and android studio normally and even these days worked. Now when I went to build, I returned these two errors: Failed to find 'ANDROID_HOME'…
-
1
votes0
answers24
viewsRename Arq with multiple upload
I have a form that contains a file type input, where I need to send several Arq at the same time: <div class="row p-3 hours_week" *ngFor="let subType of finalResultTotal"> <input…
-
1
votes1
answer417
viewsAngular 7 - Remove/Update objects from a list and update in DB (Primeng - Picklist)
I’m using the Primeng picklist, just like this tutorial: picklist tutorial I am using the event onMoveToTarget and onMoveToSource to get the object information: <p-pickList…
-
1
votes1
answer1128
viewsReact Starter. Take data typed in Input
Hello I’m studying the Reactjs... and made the following structure: [code] class MyNascimento extends Component { constructor(props) { super(props); this.state = { nascimentoValue: null, }; }…
-
1
votes2
answers399
viewsTypeerror: sheets.foreach is not a Function typescript [on hold]
I’m trying to display the data of some interns using a card library made by another developer. The application was all done in Angular (including lib). A few weeks ago, everything was working, but…
-
1
votes2
answers917
viewsAngular 7 - Add a datatables to the component
I am using this datatable: Angular Datatables I followed the stripe of the examples cited on the site, but the datatable does not appear (does not load), only the html table appears on the screen.…
-
1
votes1
answer14955
viewsAngular 7 - How to make "Else if" with "*ngif"?
I am trying to make an "Else if", to present the items of the category chosen by the user through a radio button. Only I only have "if" and "Else" to present on ng-template. I set up a sequence of…
-
1
votes2
answers121
viewsTypescript
So guys, I’m making an html page in which I’m using Typescript, and I wasn’t able to get the value of an id, until I saw in a query in the stack that should be used this way…
-
1
votes3
answers375
viewsGo through a for to fill a table in pdfMake
I am building a pdf of a sale. I am performing dummy data testing to validate the document layout. But the layout is "popping" as you go through the for. This is my code: createPdf() { var column =…
-
1
votes1
answer185
viewsHow to change the color of a Row with a ngx-datatable active Selected?
Good afternoon, everyone! I have tried several ways to make a color change of an ngx-datatable Row, but only way I could was to change the color Hover of my Row. What I need is to change the color…
-
1
votes1
answer1821
viewsThe data property does not exist in type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. ts(2322)
Português: The type '{ data: Undefined; }' cannot be assigned to the type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. A…
-
1
votes1
answer579
viewsListing an array within an angular JSON
Good morning gentlemen, I am using the IGDB (Games) api for the realization of an angular site 7(typescript), in it when receiving a JSON I receive only the gender ID, but if in the call…
-
1
votes1
answer558
viewsI need to export a variable from one typescript to another, but the variable does not get the value I need
I need to export the language variable of a ts to another, however, the variable (language) that is being exported does not present the value that I want to export. I tried to put the export in some…
-
1
votes0
answers22
viewsHow to create Typescript interface that reflects firestore structure
Good morning, I’m getting data from firebase firestore with a structure that I’m having trouble representing as a model in Typescript, that is, an interface. I made a JSON representation to…
-
1
votes1
answer57
viewsCheck if a tag has a class using Typescript
I am creating to do a search in a Bootstrap table according to what the user selects in a select. For this I am putting a class with the value equal to the value of <option> of select. I’m…
-
1
votes3
answers515
viewsButton type reset calls a function
I have a web form on which I put a input type="reset", to delete the form data in case the user needs it. The button works and is erasing the data as desired, but I’m having a problem. I have a…
-
1
votes0
answers234
viewsNgfor showing only one result - Ionic
Personal I need some help from you. I am trying to show you the information of each ion-card on a Footer. The idea is as follows: On the homepage will have ion-card with summary information of the…
-
1
votes0
answers181
viewsCreating a repetitive Ionic table
Let’s get down to the problem: I need to create a table by Ionic that, as in the Instagram album, is divided into 3 images per line, this code was made by angular. Here’s my HTML code in Ionic:…