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
answer533
viewsHow can I pass multiple parameters in an HTTP request at Angular 6?
Below I have my class of services, but when performing the search with parameters, the parameters are not passed to the request. Can someone help me? import { HttpClient, HttpHeaders, HttpParams }…
-
-1
votes2
answers345
viewsJSON with array within IONIC 3
I would like to know how I recover the data coming from a Rest api, where I have an array within a Json. Example Below: [ { "Presencas": [], "Turma": { "Alunos": [], "Voluntarios": [], "Id": 1,…
-
-1
votes1
answer311
viewsService for sending SMS or Push Notification
I have an application developed in Angular 7 that is in the final stages of development. This application makes use of Firebase services, one of which is the Cloud Firestore. I’m looking for a way…
-
-1
votes1
answer96
viewsReturn false does not work Typescript
I am making a code with Typescript and I check if a field has less than 9 digits, if it has less than 9, should not proceed to Ubmit, but for some reason it is proceeding. <form method="post">…
-
-1
votes1
answer39
viewsI need to add the percentage value to the caption (Chartsjs)
I wanted to add the value of percentages to the caption, I have tried several ways, and still could not the solution to my problem. Component with chart settings @Input() chartData: chartData;…
-
-1
votes1
answer224
views*Ngfor is not traversing the array in html
I am consuming the Wirecard API to perform an integration, the moment I try to return all the cards that are registered to a client, I can get them only in the console.log menu, when I try to go…
-
-1
votes1
answer587
viewsAngular Error: Property 'Controls' does not exist on type 'Abstractcontrol'
I’m having trouble setting values within form inputs. My form.component.ts: // Form this.constituicaoForm = this.fb.group({ // Contrato descricao: ['', Validators.required], modalidade: ['',…
-
-1
votes2
answers1783
viewsHow to add item to an array list at angular
I have a script registration screen and on this screen I can add n scenarios, I’m using angular, I can add the items in the list, but while typing in the input it changes the items that are already…
-
-1
votes1
answer221
viewsHow to update the values of my form through a modal?
I have a form to fill out a sale, this form will be assembled according to the information that the user will choose by modal. I can normally receive data from modal, but my form does not update the…
-
-1
votes2
answers58
viewsChange background VIDEO by screen size?
How to use different background video by screen size , Desktop would be a <video> Mobile would be another <video> Design in Angular .. <video playsinline="playsinline"…
-
-1
votes1
answer215
viewsReactive Forms Ionic 4, data call
I used ngModel to take data from an api and move to a form, where the user typed the zip code and obtained the data, but as it will be discontinued, I will switch to reactive Forms, now I’m having…
-
-1
votes1
answer509
viewsChange a component through another component - Angular 8
Guys, I have a Nav component where owns the company logo and a Home component, however, Home could not exist the logo I have in Nav. What would be the hidden forms of the logo when the home route…
-
-1
votes1
answer33
viewsHow to assemble a reactive fomulario through an input radio?
You guys can help me? I built a radio component and depending on the value of it will be rendered a new form, follow my HTML <div class="ui-g-12 ui-md-4 center-zone"> <msp-radio-group…
-
-1
votes1
answer44
viewsCancel subscribe
I’m performing a call to API that returns me a list of any obj when I click on a button. That is if I click twice in sequence, the API returns me the same list in sequence as well. My question is,…
-
-1
votes1
answer1488
viewsAngular - Can’t bind to 'ngForOf' Since it isn’t a known Property of 'div'
In an Angular8 application the component created does not identify the *ngFor command, and returns error: Can't bind to 'ngForOf' since it isn't a known property of 'div'. View Accounting Component…
-
-1
votes1
answer218
viewsCan’t find the module
That mistake you’re making, I’m following a course and the teacher’s wheel, mine gives that mistake! C:\Program Files\nodejs\node.exe --inspect-brk=34110 build\server.js Debugger listening on…
-
-1
votes1
answer4663
viewsProperty '' does not exist on type ''
I’m picking up an error while doing the Build of my angular application, the error is this: Property 'resource_name' does not exist on type 'Produto[]' Here is my TS code and HTML. The call by form…
-
-1
votes1
answer407
viewsAngular Reactive Forms validation by clicking the button
Hello, I’m trying to create a validation to check if there is already a Cpf in the database (fictional), only that I wanted to change the trigger, instead of triggering the validation on keyup…
javascript angular typescript validation reactive-programmingasked 4 years, 1 month ago Renan Duarte 37 -
-1
votes1
answer2287
viewsUnhandled Promise rejection typescript and Node.js
Good night to you all! I am developing an app with React, Node and typescript and was programming a route with post method for inserting data using sqlite database and testing in India but when…
-
-1
votes1
answer163
viewsAngular 9 + error when passing variable in direct html function
Guys, I have a question about a mistake that I don’t understand why. I have a function that I run by a click, this function has to pass a single value and is passing(tested via console.log).…
-
-1
votes1
answer405
viewsReact with Typescript : Error on a map in the image array
Interface: interface CompanyDetails { company: { id: number; name: string; description: string; whatsapp: string; instagram: string; email: string; }, filesCompany: [ { url: string; name: string;…
-
-1
votes1
answer110
viewsHow to reload an Angularcomponent when I navigate to the same route?
I’m doing a school project, and in it I have a navbar that has several buttons with routerLinks at the angle, when I click on them, they take me to a route with the path: 'busca/:type/:id'. When…
-
-1
votes1
answer158
viewsAngular - Search vector data at Storage location and populate table with data
How do I search for the data stored in the Storage location and populate the table with the result obtained in the search For example: I search by year or by manufacturer or by model and the table…
-
-1
votes1
answer834
viewsMultiple file uploads with React.js and typescript
I’m using middleware multer to upload files, but on the front end (with React.js) when using the form-data to get the files selected by the user , but I can’t send to the back-end, I’ve already…
-
-1
votes1
answer1596
viewsError creating execution script for ts-Node-dev library
I am building the back-end of an application using Node.js and Typescript, I decided to create a script in package.json to facilitate the execution of the system I inserted the following script:…
-
-1
votes1
answer263
viewsInheritance with Typeorm
There are common problems that I see a lot of difficulty to deal with Orms, and ignoring a native way I decided to ask what is the best way to deal with these using Typeorm in project. Today I have…
-
-1
votes1
answer87
viewshow to get an id with knex and typescript?
I am creating my database with Knex for an application made in React with Typescript. The application will be a service contracting site, where a service provider registers his work and a user…
-
-1
votes1
answer86
viewsHow to mock a constant object in Jest
Hello I have got a constant file set like this in an React project: src/constants/env.ts export default { PROD: ['prod', 'production'].includes((process.env.NODE_ENV || '').toLowerCase()) } This…
-
-1
votes1
answer406
viewsReact - Dynamic table - Adding and removing rows from the table
I wrote the following code below, it is 100% functional with one exception. By clicking "remove" on the desired line, it removes the last line, not the correct one (that is, add 5 lines, ask q to…
-
-1
votes1
answer124
viewsRounding a value in Typescript
How do I enter a number, how do I add it in the code (imc calculator in typescript)?. And how do I add it in the code ifs to inform healthy, obese, about weight, etc... const calculadora =…
-
-1
votes1
answer292
viewsUnform does not return the validation error
Staff I am developing an app and using the unform of Rocketseat for form validation. But when trying to create a validation error by displaying the component border in red if it is empty, the error…
-
-1
votes1
answer93
viewsAngular does not recognize variable inside a Javascript Function, integration with Pagseguro
I am consuming Pagseguro service in an Angular application version 10.2 and I am having this problem: Inside a function in my component I call an object of type PagSeguroDirectPayment, and I can’t…
-
-1
votes1
answer2220
viewsCannot use import statement Outside a module - Typescript and Babel
I have the following setup: Package.json: "scripts": { "start": "node dist/server", "build": "babel src --extensions \".js,.ts\" --out-dir dist --copy-files --no-copy-ignored", "dev:server":…
-
-1
votes1
answer27
viewsI wanted to know why I can get the parameters of the verbs POST, PUT and DELETE in PHP only with Jquery, how do I do this pure JS?
I wanted to know how I send parameters of the methods: POST, PUT, DELETE as Jquery does For you to understand better, I just want to send some data and take PHP. If you look below you can see that…
-
-1
votes1
answer170
viewssetInputText is not Assignable to type 'Intrinsicattributes & { Children?: Reactnode; }'
I have this variable that returns an error: Type '{ setInputText: Dispatch<Setstateaction>; }' is not Assignable to type 'Intrinsicattributes & { Children?: Reactnode; }'. Property…
typescriptasked 3 years, 4 months ago Inês Barata Feio Borges 313 -
-1
votes1
answer243
viewsProperty 'filter' does not exist on type 'Setstateaction<Never[]>'
I’m having trouble getting this little piece of code to work: Here is my code: import React, {SetStateAction} from 'react'; import {BsCheck, BsTrashFill} from 'react-icons/bs'; type Props = { text:…
-
-1
votes1
answer78
viewsRun script compiled using typescript + Babel + typeorm
While trying to execute node .\dist\index.js compiled using Babel have the following error: In dev runs without errors, all tests also pass, consuming the API also everything normal, but when I…
-
-1
votes1
answer27
viewsLoading in Angularfireauthguard
Some way to implement a Canactivate loading in Angular 11? import { NgModule } from '@angular/core'; import { AngularFireAuthGuard, redirectUnauthorizedTo } from '@angular/fire/auth-guard'; import {…
-
-1
votes1
answer58
viewsTreatment of negative test cases with JEST
I have a Code Jest who should test a business rule that says: No client must have an invalid CPF it(" should not be able to create a new user whith a wrong CPF",async()=>{ const repositoryFake =…
-
-1
votes1
answer86
viewsHow to expect an HTTP request to end at Angular 5
I am creating a method that makes an HTTPSERVICE request in my API but I need to finish this request before continuing the rest of my Method, as I could force Angular to wait for the end of my…
-
-1
votes1
answer343
viewsPercentage mask with React-input-Mask in React js with typescript
I have to create a mask for an input in the project we are already using the React-input-Mask https://github.com/sanniassin/react-input-mask#beforemaskedstatechange The solution does not necessarily…
-
-1
votes1
answer170
viewsBecause when I install Axios in my next application I can’t run it?
I’m learning Nextjs and wanted to create a project with Next and Axios but whenever I install Xios the application stops working. Note: this project also has Typescript and Styled-Components…
-
-1
votes2
answers72
viewsInitialize object with defined type without specifying each value
I would like to initialize an object without setting each value in Typescript Let’s simulate a simple situation where we have the Car Object: export interface Carro { QuantidadePortas: number,…
-
-1
votes1
answer29
viewsHow to fire event once loading the form?
I have a form that receives parameters with which I perform a get on the server, bringing and rendering the information to the user. Currently this get is done by calling a function on onClick of a…
-
-1
votes2
answers65
viewsProblem with Next, Typescript and Eslint
I’m starting a project with Next, Typescript, Eslint and Prettier. After starting the project, adding Typescript, Eslint and Prettier started getting an error that I can’t find a solution to, I…
-
-1
votes1
answer12
viewsBalance based status update
I am developing a project with typescript and am unable to use js in it. this project has several routines, and in most of them has this status question, whether it is open, closed or blocked…
-
-1
votes3
answers45
viewsI can’t get the "id" parameter of the URL in Angular 12 using Activatedroute?
The URL 'user/1' for example, it doesn’t work. But I use '/user? id=1' works and I can list but it’s not in the format I want. In my builder I declared an attribute ActivatedRoute, which I use in my…
-
-1
votes1
answer23
viewsError building my project in Nextjs
I am having problems building my project for Vercel, if it is necessary to look at the code of my project it is here https://github.com/lucasbpereira/lgpdmap yarn build yarn run v1.22.5 $ next build…
-
-1
votes1
answer34
viewsLife cycle and React variables (state and useEffect)
I’m having trouble understanding React’s life cycle. Project summary: React repeatedly retrieves information from an API (setInterval) with certain filters, where filters are also the result of a…
-
-1
votes1
answer38
viewsHow to handle dynamic payloads in Node.js?
Hello, I would like to know what would be the best way to model the receipt of payloads with dynamic data, IE, I can sometimes receive a request with 3 fields, other, with 5, etc. For example, in…