TypeScript is a typed superset of JavaScript created by Microsoft that adds optional types, classes, async/await, and many other features, and compiles to plain JavaScript. This tag is for questions specific to TypeScript. It is not used for general JavaScript questions.

learn more…| top users | synonyms|typescript jobs

0
votes
0answers
3 views

TypeScript Duplicate Identifer

In the following TypeScript fragmentexport class Customer {firstName : string="";lastName : string="";fullName : string="";constructor(public firstName, public lastName) {...
0
votes
0answers
7 views

Angular 5: Deeply nested child routes error

I am trying to define child routes 4 levels deep, and the 4th level is giving me an error for some reason, but the exact same logic on levels 1-3 work perfectly fine.Here is an example route:const ...
0
votes
0answers
4 views

Angular 4 Dynamically creating components and later retrieving list of created components

I want to dynamically create several components, some of which may be later deleted. Eventually, I want to perform an action on all components that still exist.Sample component to be created:class ...
0
votes
1answer
4 views

Access a Library written in Kotlin from a TS Angular Webapp

I have a library written in Kotlin that I want to use from an Angular Webapp written in TypeScript, but I end up getting Uncaught Error: Error loading module 'js'. Its dependency 'kotlin' was not ...
-2
votes
1answer
19 views

angular cli doesn't create the Component

it is just console this message Cannot read property 'NullLogger' of undefined TypeError: Cannot read property 'NullLogger' of undefined
1
vote
1answer
18 views

Angular AoT Custom Decorator Error encountered resolving symbol values statically

I created a decorator to help me with handling desktop/mobile eventsimport { HostListener } from '@angular/core';type MobileAwareEventName=| 'clickstart'| 'clickmove'| 'clickend'| '...
0
votes
1answer
15 views

Typescript: enum keys as parameter to function

I have this enum enum methods {DELETE=1,POST,PUT,GET}I want to have a function accepting a parameter that can be one of the keys of the methods enum. const getMethodPriority=(...
0
votes
1answer
11 views

Modular progress bar

I am trying to make a modular animated progress bar that I can use like so:<bar [type]="'health'" [percentage]="'80'"></bar>It is working to the point I need to set different ...
0
votes
0answers
10 views

Redux withRouter to update blocking component but get Property does not exist on type Exception

I am using React Router on an single page app with a side navigation and am writing the application with TypeScript + Redux. However, I ran into an issue with a container component, which is navigated ...
0
votes
2answers
16 views

How to Bind Property from one component to App.Component in angular 4?

test.component.html<input type="text" name="fname" [(ngModel)]="user"><buttonclass="btn btn-primary">Update Server</button>test.component.tsimport { Component, OnInit } from '...
0
votes
2answers
17 views

Typescript json formation through arrays

my json object structure should becustomers: [{customer: [{ key: 'customername', value: 'xxxx' },{ key: 'address', value: 'xxxxxx' }]}, {customer: [{ key: 'customername', ...
0
votes
2answers
9 views

Parameter type ISO Date Format?

Is there a way to define a parameters type to a date time format like:setDate(date: "YYYY-MM-DDTHH:mm:ss.sssZ") {this.date=date;}
0
votes
2answers
27 views

typescript. array returning type of argument

function last(anArray:any[]) /*:????*/ {return anArray[anArray.length-1];}Without resorting to generics, is it possible to specify the return type in the function above being the type of the ...
1
vote
2answers
18 views

Infer tuple type instead of union type

Does anybody know how to make compiler to infer tuple type automatically ?// Now: (string | number)[]// Wanted: [string, number][]const x=[ ["a", 2], ["b", 2] ];
1
vote
2answers
20 views

jest mocking promise method called wrong number of times

As part of my redux action, it makes several sequential api requests. The apiCall method returns a Promise with some value, and that value is used by a subsequent apiCall to make another request, and ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,