Questions tagged [typescript]

0 votes
1 replies
Typescript Enum Object.values() return value
Why does Object.values() and Object.keys() always give both the keys and the values? Consider the following code: enum Enum { FOO, BAR...
asked 4 months ago
0 votes
1 replies
Check a recursive JSON structure for matchinig numerical values in Set in Typescript Angular
I have a UI where initially a User has to check some checkboxes. The checkboxes have sequential IDs. The JSON Structure for it is as follows: {...
asked 4 months ago
0 votes
0 replies
How to dynamically change headers in ng-smart-table?
I need to change the column names or headers in ng-smart-table, either dynamically or after some event. I use the tableSettings to define the f...
asked 4 months ago
-1 votes
0 replies
Can't uncheck checkbox using angular
I'm using a list of checkboxes in order for the user to choose a role. Only one checkbox must be selected at all times. So if I was to uncheck a...
asked 4 months ago
0 votes
1 replies
testing private functions in typescript with jest
In the below code my test case was passed as expected but i am using stryker for mutation testing , handleError function is survived in mutation...
asked 4 months ago
0 votes
3 replies
Sorting Array of Objects by Object Name Typescript
Using TypeScript, I am trying to sort an array of Objects by the name of the actual object, not an object key. A name key does exist on these obj...
asked 4 months ago
0 votes
1 replies
When uploading a single file, Filepond submits an empty file before submitting the “real” file
I'm trying to understand what Filepond is uploading to my server method and I've run across something really confusing. I'm only using the proces...
asked 4 months ago
0 votes
1 replies
TypeScript - “debugger;” statement does not work while working with QA Environment in Angular
I am working on a angular application with a setup of various environments. I am facing issues when I am trying set up some debug points using de...
0 votes
2 replies
Test stops with conditional action on element.isDisplayed and element is not displayed
In my test I have a condition to check if a popup is displayed. If so, the cancel button is clicked. But if the popup is not shown the test stops...
asked 4 months ago
0 votes
2 replies
How to set an interface on an existing, but currently unknown, key/value pair?
I have the following interface: interface Item { _id: string; name: string; amount: number; type: 'a' | 'b' | 'c'; value:...
asked 4 months ago
-1 votes
1 replies
How to use SUPER class while extending it from an Abstract class
I have an abstract class which has 4 arguments in its own constructor: export abstract class AbstractType implements OnInit, Destroy{ constructo...
asked 4 months ago
0 votes
3 replies
How to hide keyboard after touch outside the textfield?
I have a cross-platform app. I have a form that has more than one TextField. I want to hide the keyboard when the user touch outside of the textf...
0 votes
0 replies
bootstrap Open custom component default bootstrap modal
Ng-bootstrap custom component modal it's working in button click (click)="modalDefault.show();" i need open in ts <app-modal #modalDefault&g...
1 votes
2 replies
Can I use type as value (or correctly infer generic class type from constructor parameter)?
I have generic class which accepts another type and the key name from this type. I want to also initialise property with this key name. I've defi...
asked 4 months ago
2 votes
2 replies
Operator < cannot be applied to types Number and boolean
I have three numbers and I am trying to compare if one of them includes in other 2. let myMonthly = this.profile.expectedpayhourlystart + t...
asked 4 months ago
0 votes
0 replies
“System is not defined” when building RESTful APIs with TypeScript
I am trying to build RESTful APIs using TypeScript and SystemJS // index.ts // Import express import express from "express" // Imports routes im...
asked 4 months ago
0 votes
0 replies
How to use case statement with forEach in angular 6?
I want to select product in app.html from typesFurniture, in the uploadFiles() function to execute the product that I've selected, but i can't ma...
0 votes
0 replies
Run puppeteer before tests and pass page to tests
I want to start a puppeteer instance in ava before all tests and pass the page to all tests, so I can work with that active puppeteer instance. I...
asked 4 months ago
1 votes
1 replies
Unsafe dictionary value assignment by key of a union type in strict mode
TypeScript looks unsound when a dictionary value is assigned by key of a union type, even when using the latest typescript@3.4.5 and strict mode....
asked 4 months ago
1 votes
1 replies
Can this be refactored to the more composable style seen in examples?
I'm pretty new to rxjs and this example I've come up with doesn't feel so elegant. Essentially how can I compose 3 drastically different observab...
asked 4 months ago
0 votes
0 replies
How to instrument angular 6 project for code coverage using istanbul
I want to only instrument my angular 6 project source code (ts files). As I don't have any unit test cases, so I'm not able to use the angular cl...
0 votes
1 replies
How to call twice a subscribed HTTP request
I'm working on app that's using SSR. While entering the app I'm sending a request to get some products. Everything works fine, because I don't se...
asked 4 months ago
0 votes
0 replies
Dropdown inside primeng table
I am using a drop down list inside primeng turbo table. I have an array that consists of two arrays that form the options for the drop down menu....
0 votes
0 replies
Isomorphic TypeScript / require
I have 4 files Settings.ts type sayType = () => string; export interface SettingsModule { sayEnv: sayType; } settings.node.ts import...
asked 4 months ago
0 votes
0 replies
npm publish dist content except dist itself
in package.json I have "files": [ "dist/*" ] In this case if I publish my package, I'll publish dist with its content. Installed package loo...
asked 4 months ago