Top "Typescript" questions

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.

In Typescript, How to check if a string is Numeric

In Typescript, this shows an error saying isNaN accepts only numeric values isNaN('9BX46B6A') and this returns …

typescript
Setting default value for TypeScript object passed as argument

function sayName(params: {firstName: string; lastName?: string}) { params.lastName = params.lastName || 'smith'; // <<-- any better alternative to this? …

typescript
Is key-value pair available in Typescript?

Is key,value pair available in typescript? If yes how to do that. Can anyone provide sample example links.

typescript
Typescript: No index signature with a parameter of type 'string' was found on type '{ "A": string; }

I have some vanilla javascript code that takes a string input, splits the string into characters, and then matches those …

javascript typescript
Angular4 - No value accessor for form control

I have a custom element : <div formControlName="surveyType"> <div *ngFor="let type of surveyTypes" (click)="onSelectType(type)" […

javascript angular typescript angular4-forms
Can't bind to 'formControl' since it isn't a known property of 'input' - Angular2 Material Autocomplete issue

I am trying to use Angular Material Autocomplete component in my Angular 2 project. I added the following to my template. &…

angular typescript angular-material2 angular-forms
How to load external scripts dynamically in Angular?

I have this module which componentize the external library together with additional logic without adding the <script> tag …

javascript angular typescript ecmascript-6
How do I prevent the error "Index signature of object type implicitly has an 'any' type" when compiling typescript with noImplicitAny flag enabled?

I always compile Typescript with the flag --noImplicitAny. This makes sense as I want my type checking to be as …

typescript
TypeScript-'s Angular Framework Error - "There is no directive with exportAs set to ngForm"

I keep getting this error while using TypeScript's Angular2-forms framework: There is no directive with "exportAs" set to "ngForm" …

angular typescript forms angular2-forms
How can I loop through enum values for display in radio buttons?

What is the proper way to loop through literals of an enum in TypeScript? (I am currently using TypeScript 1.8.1.) I've …

javascript arrays typescript enums element