Category "typescript"

Angular: 7.2.1 ES6 class ReferenceError : Cannot access 'X' before initialization

I'm having the following TypeScript class export class Vehicule extends TrackableEntity { vehiculeId: number; constructor() { super(); return supe

How to create nested moduleNameMapper in Jest?

My simplified jest.config.js is: module.exports = { preset: "ts-jest", collectCoverage: true, collectCoverageFrom: [ "src/**/*.ts", "!**/node_mod

How to save Dynamic Form Answer in Angular?

I'm trying to save some data that I display dynamic in the browser.This is my HTML where I iterate trough a list of exam questions dragged from the database and

How to give a unique constraint in lucid model, I am using lucid in adonis with typescript

In adonis.js i am trying to add a unique constraint to email field just like we do it in sequelize,prismajs or any other orm.Is it posible to add in adonis.

Disable the entire form at once (Angular reactive form)

Is there any way to disable the entire form in angular when using Reactive forms. I know it is possible to make them disable one by one. this.tempForm = this.

Web socket problem when adding subscriptions in URQL client

I am using URQL Client with Apollo server, now I am trying to handle subscriptions on URQL client, but I can't seem to make the web socket work. Hope someone ca

Cannot find module that is defined in tsconfig `paths`

I am trying to setup aliases for my mock server. Whenever I try to compile ts files, it returns error that it couldn't find proper modules even though those are

typescript: decorator in abstract method

I have the following class: export abstract class CanDeactivateComponent { abstract canLeavePage(): boolean; abstract onPageLeave(): void; @someDecorato

How to dynamically render a markdown file in Angular?

I'm trying to write an Angular component that renders markdown files as part of the webpage, using the ngx-markdown library. Looking at the library's official

Angular 4.3.3 HttpClient : How get value from the header of a response?

( Editor: VS Code; Typescript: 2.2.1 ) The purpose is to get the headers of the response of the request Assume a POST request with HttpClient in a Service i

Trying to persist not discovered entity of type object

The problem I'm new to Nest.js and Mikro-ORM, which I have to learn as a job requirement. This stack requires TypeScript, which I despise from the bottom of my

Property 'entries' does not exist on type 'ObjectConstructor'

I'm working on an ng2 implementation. I'm using the following function call to convert an object to an array: var authors = Object.entries(responseObject.Author

How to use TypeScript + Composition API + Vuex (namespaced)?

I'm currently trying to create a Vue 3 Application that utilizes the Composition API with Vuex 4 (namespaced) written in TypeScript. There are tons of different

Return observable while doing task - Firebase Functions

I have a function in my Firebase Cloud Functions that needs to run a scraping task. While the function is scraping the public website I need to return to the co

Javascript Equivalent to C# LINQ GroupBy

This is a follow up question to the following question: Javascript Equivalent to C# LINQ Select We are using Angular 2 + TypeScript: I have an Array of objec

How to implement a parameter decorator in TypeScript?

I've been trying to use a parameter decorator @logParameter: class Person { public name: string; public surname: string; constructor(name : string, sur

Capitalize the first word (or optionally all the words) of a sentence in angular 2+

I am trying to capitalize words of a string in the angular 2 template (aka view) but I get the following error in the console and the application does not load

How to implement two html files for the same component in angular 9? One for mobile sized and one for desktop?

I would like to implement an application with multiple components and modules using Angular Material for desktop and Ionic for mobile. So far, the solution I fo

How to make VSCode show me strictNullChecks Typescript errors

When I build my project with the following tsconfig.json, I get an error due to recently adding strictNullChecks: true. { "version": "2.3.4", "compiler

Explain "export =" and "export as namespace" syntax in TypeScript

I am trying to make use of the type declarations files in the DefinitelyTyped repository. Many of these files use the following pattern: export = React; export