Category "typescript"

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

Typescript: validate type after using type assertion

Is there a way to allow strict type checking on a value after having used a type assertion? For example, sometimes I need to construct a function type that has

Why doesn't the exports field of npm work in typescript?

Our library @ltonetwork/lto, is written in typescript. We use tsc to compile to javascript in the lib folder. The package contains several sub-packages, which a

Angular 12 Getting Id of Selected Product

I want to get the id value of the selected product in my Angular 12 project, I used NgModule for this, but unfortunately it does not work. What is the reason fo

How to correctly declare static refs in Composition API using Typescript?

I am using the Composition API (with <script setup lang='ts'>) to create a ref, used in my template: const searchRef = ref(null) onMounted(() => { sear

Array<Type> VS Type[] in Typescript

As far as I know a property's type can be defined in two ways when it's an Array. property_name: type where type can be either Array<string>, Array<

How do I pass data to Angular routed components?

In one of my Angular 2 routes's templates (FirstComponent) I have a button first.component.html <div class="button" click="routeWithData()">Pass data an

How to add custom arrow buttons to Alice-Carousel?

I am making a carousel component with alice-carousel (https://github.com/maxmarinich/react-alice-carousel/blob/master/README.md) but having trouble customising

How to extend anonymous type in Typescript

When chaining functionality in typescript with anonymous types for example like this: let array = [{ seed: 2 }, { seed: 3 }]; array .map(i => ({ see

The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type

1 interface Dimensions { 2 width: Number, 3 height: Number 4 } 5 6 function findArea(dimensions: Dimensions): Number { 7 retur

Missing "Go to Definition" from VSCode menu

I am working on Typescript/Javascript project using VSCODE. I use to hover mouse on the method and can see the function definition, cmd + click go the definitio

TypeORM column type dependant on database

I have simple entity @Entity() export class File { @PrimaryGeneratedColumn() id: number; @Column({type: "mediumblob"}) data: Buffer; } Which

Is there something like Lombok for TypeScript?

I'm looking for a way to reduce the boilerplate code of my NodeJS backend. In Lombok there is e.g. the possibility to inject constructors and getter/setter by a