Category "typescript"

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

function declaration for a generic function return wrapper

How to declare the function wraps that takes any function and returns a version of it that differs only in returning an object that wraps the original return ty

How to use normal imports and top-level await at the same time?

I want to use imports (import x from y) and top-level awaits at the same time with ts-node. However if I change my tsconfig.compilerOptions.module to es2017 or

Error while importing a module with optional chaining

Project setup: Vuejs 3 Webpack 4 Babel TS We created the project using vue-cli and add the dependency to the library. We then imported a project (Vue Currency

Show Validation Message on submit in Angular 4 Reactive Forms

I am using Angular 4, Reactive forms.I want to show validation error message when the user clicks on Submit/Create Account button. Here is the HTML and typescr

Unable to import svg files in typescript

In typescript(*.tsx) files I cannot import svg file with this statement: import logo from './logo.svg'; Transpiler says:[ts] cannot find module './logo.svg'.