Top "Typescript2.0" questions

Tag for questions specific to new features in TypeScript 2.x. For general TypeScript questions, the correct tag is TypeScript.

TypeScript and React - children type?

I have a very simple functional component as follows: import * as React from 'react'; export interface AuxProps { children: React.ReactNode } …

reactjs typescript jsx typescript2.0
'this' implicitly has type 'any' because it does not have a type annotation

When I enable noImplicitThis in tsconfig.json, I get this error for the following code: 'this' implicitly has type 'any' …

typescript typescript2.0
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 …

javascript angular typescript request typescript2.0
What is the Record type in typescript?

What does Record<K, T> mean in Typescript? Typescript 2.1 introduced the Record type, describing it in an example: // …

typescript typescript2.0
TypeScript Import Path Alias

I am currently working on a TypeScript application which is comprised of multiple Node modules written in TypeScript, that are …

typescript typescript2.0
Typescript Array find element by index

Finding and assigning a CategoryApi object having categoryId export class CategoryApi { categoryId: number; name: string; } categories: CategoryApi[]; selectedCategory: CategoryApi; selectedCategory = …

angular typescript2.0
'ts-node' is not recognized as an internal or external command, operable program or batch file

I'm getting error in my Vs Code terminal and command prompt that 'ts-node' is not recognized as an internal or …

node.js typescript2.0 ts-node
TypeScript check for empty string

Is there a way for TypeScript to statically check for an empty string? Is there a way to statically require …

typescript typescript2.0
Typescript: Is there a simple way to convert an array of objects of one type to another

So, I have two classes Item { name: string; desc: string; meta: string} ViewItem { name: string; desc: string; hidden: boolean; } I …

arrays typescript type-conversion typescript2.0
Typescript error This condition will always return 'true' since the types have no overlap

I having this condition on a form group: if((age>17 && (this.frType=="Infant")) || (age>40 && …

javascript angular typescript typescript2.0