Category "typescript"

animateChild() for nested Angular child animation not working

I would like to fire two animations at the same time on click. The animation triggers use the same state, one is placed on an outer parent div and the other is

How to generically map over values of object in TypeScript (where object keys are a string union)?

Suppose I have two types: type Credentials = { Username: string; Password: string; }; type XmlCredentials = { [k in keyof Credentials]: { _text: string } }

How can I make dynamic url to external site in angular5?

When I'm trying to make link like this: <a [href]="getUrl()">click me</a> getUrl() { return this.domSanitizer.bypassSecurityTrustUrl

How to omit an union type depending on field value

I have this type (come from third party library): type StackActionType = { type: 'REPLACE'; payload: { name: string; key?: string | unde

Config route in react-router-dom v6

I am using react-router-dom with typescript. I create a config file like below: export interface RouteComponent { path?: string; element?: React.ComponentTy

Ant design sort table code not working on the react typescript

I used following ant design sort table code in react type script, its not working correctly anyone know how to do that correctly My code here import

How do I configure prettier to format tsx file which use styled component?

Here is what is expected after formatting my file : export const StyledDiv = styled.div<StyledDivProps>` width: 56px; height: 30px; `; And this i

class-validator validate union type

I have a mongoose discriminator schema, which mean the data will be different according to one of the attributes. class Feature { name: string option: Colo

How to watch and reload ts-node when TypeScript files change

I'm trying to run a dev server with TypeScript and an Angular application without transpiling ts files every time. What I found is that I can run .ts files with

How can we achieve browser zoom in and zoom out in playwright?

Need to find a way to zoom browser in and out during an e2e test run. Below code does not work. await page.keyboard.down('Control'); for (let i = 0; i < 7;

How to use TypeScript with Sequelize

I already have my server application written in Node, PostgreSQL, Sequelize using Fastify. Now I would like to use TypeScript. Can anyone tell me how to begin

Handle null with localecompare typescript

I have the following sort: let sortedCon = this.con.sort((a, b) => a.lastname.localeCompare(b.lastname)); I am trying to get it to handle nulls and mainta

How to create new event for unit testing in Angular 2?

Hi I am writing unit test case for my angular code. I am trying to update textbox in gridview. Below is my gridview code. <input *ngIf="editing[rowIndex + '

Module not found: Error: Can't resolve 'path'

I have an Angular CLI project which I just upgraded to Angular 6. Now when I try to build my app, I get the following errors: ERROR in ./node_modules/postcss/

Module parse failed? I need help setting up Babel

I'm writing my first JavaScript library and I'm testing it locally with a React project. I'm not seeing any Typescript errors when I'm writing my code but when

How to create tables in Postgres RDS using CDK?

I created a Postgres RDS database using the CDK. I read the documentation but didn't find a way to create tables through it. The language I'm using is TypeScrip

MUI5 theme aware sx prop and type checking

When using the sx prop and leveraging theme aware properties in TypeScript. Is type checking happening? How can I confirm this?

How can I unit test that a guard is applied on a controller in NestJS?

I've got a controller configured in NestJS and I want to check that the appropriate guards are set - does anyone have an example of how it could be done? This

NullInjectorError: No provider for StateObservable when using ng-packagr

I have an Angular 5 project that uses ngrx/store. The project consists of an application and a shared library that the application uses. Up until today, we had

Firebase Cloud functions: Typescript does not compile to JavaScript

Cloud function on my computer works with Javascript, but when I try it using TypeScript it does not compile to Javascript. It does not event create lib/index.js