Category "typescript"

Move focus to next control on key Enter

I have found some project on Angular 1.x where user can move focus to next control by pressing Enter key. 'use strict'; app.directive('setTabEnter', function

Fucntion not working inside razorpay ondismiss callback in Angular 12

I have a function inside ondissmiss callback options.modal.ondismiss = () => { console.log("its working"); this.detectChanges(); this.isPaying = false

Function inside ngIf is called multiple times, after a single click event- Angular2_Typescript

Hello this is the first time I qm putting question on stackoverflow. I am developing an application in angular2: v2.1.0 (typescript- v2.0.10). I am using "ng2-

Separate event block to events by interval in full calendar

app.component.ts @ViewChild('calendar') calendarComponent: FullCalendarComponent = <FullCalendarComponent>{}; calendarOptions: CalendarOptions = {

Changing user-agent on puppeteer-extra doesn't seem to take affect

I'm trying to scrape different websites using puppeteer. As I'm using puppeteer-extra for that (for their stealth-plugin), I've decided to use their anonymize-u

Getting 'ReferenceError: describe is not defined' error when going to start the application

I'm going to test typescript(inversify) code using jest. Below mentioned the code that use to test a controller method. describe('Test UserController',() =>{

typescript: Cannot find module 'react'

I don't understand why it can't find it. $ cat tsconfig.json { "compilerOptions": { "sourceMap": true, "target": "es6", "jsx": "react", "typ

Typescript input onchange event.target.value

In my react and typescript app, I use: onChange={(e) => data.motto = (e.target as any).value} How do I correctly define the typings for the class, so I woul

How to infer types from an imported file in Typescript

I have a tricky Typescript problem I can't seem to solve. I would like to infer values based on a generic. However, the catch is the inferred types needs to com

How to import a single-spa in-browser utility module into a TypeScript parcel project

I have 3 TypeScript projects below: root-config parcel, let us call it my-app in-browser utility module, let us call it api All the projects above were generate

Using JavaScript need to group elements

I am looking for efficient method to modify my object list which looks something like this: const pets = [ {type:"Dog", name:"Spot"}, {type:"Cat"

How to watch file changes with ts and js build

I have a project with fastify, apollo server fastify and nx. I want to add a script to build my code and run the js files. the problem is that if I make any cha

TypeScript typings give me "index.d.ts is not a module"

I am getting File node_modules/@types/webrtc/index.d.ts is not a module with this code: import * as webrtc from "webrtc"; const peerConnection1 = new RTCPeerCo

How to define types of the auth properties in socket.io-client

Question I am using socket.io-client with typescript. When creating a socket instance, I set a token property in the auth of the Socket options, but an type err

Error starting TypeScript language service in WebStorm 2018

I'm new to using WebStorm (v2018.2 on Windows 7) and trying to work with TypeScript. And I am getting following error, despite trying many combinations of the T

How to override a property to be non-nullable in Typescript

The DefinitelyTyped definition of the Node built-in IncomingMessage (the type of req in the (req, res, next) arguments) has defined url to be nullable. Here's t

Typescript paths not resolving when running jest?

Attempting to convert this project over to jest using these instructions. I have everything working except for the files that use the paths configuration: "pa

Angular 2 Animation - boolean trigger?

I'm trying to trigger a transition bound to a boolean property, but this doesn't seem to fire. Here is a cut down version of my animation trigger trigger( '

Module build failed: UnhandledSchemeError: Reading from "alias:/path" is not handled by plugins (Unhandled scheme)

I am creating a new react app and trying to configure webpack compiler from scratch. The issue happens when running the build command with webpack -c config/web

Use async await with Array.map

Given the following code: var arr = [1,2,3,4,5]; var results: number[] = await arr.map(async (item): Promise<number> => { await callAsynchron