Category "typescript"

ng-bootstrap Datepicker defaulting the navigation year to 10 years before the current date

I believe the default behaviour is to default the Year navigation to the current year with 10 years prior as the minimun date and 10 years forward as the maximu

Property 'current' does not exist on type '[boolean, Dispatch<SetStateAction<boolean>>]'.ts(2339)

I am adding cursor animations to a React/Typescript project and in researching came across a CodePen (Animated Cursor React Component) that works perfectly well

How to detect dead or unused code in Angular?

I and my team are working on an angular application from more than a year now. As part of our code refactoring process we want to delete unused or dead code fro

How to clear pre-defined blockly custom blocks in Angular

I have some problem initializing custom blocks I created blockly custom blocks to modal export const ConditionBlocklyBlock: Block[] = [ { type: 'SUM_MAT

TypeScript: Interface cannot simultaneously extends two types

I'm writing a React app using TypeScript. I use material-ui for my components. I'm writing a custom wrapper for material-ui's Button component. It looks like th

Cannot find a differ supporting object '[object Object]'. NgFor only supports binding to Iterables such as Arrays

here is code i am trying to access object of objects. template <table class="table table-striped"> <tr *ngFor="let response of response"> &

NextJS + Typescript built failed with @auth0/nextjs-auth0

I'm using Typescript for NextJS and I cannot build the application because it has some issues with the auth0/nextjs-auth0 This is the issue. If I install this,

Generic function to convert string to typescript enum

I found this great answer about how to convert a string to a typescript enum. Based on that I have written this function enum Color { Red='red', Green='green'

TypeScript optional properties not accepting undefined value

<MyCustomField type={props.type} MyCustomField's type type definition: type?: string; props.type's type definition: type?: string; For some reason, I

Call function stored as class property

I have a class Process that takes in a type of object () => void in its constructor. Whenever I pass this into the object, all appears fine and well, however

Use Quasar App code in background script of BEX

I am developing a browser extension using Quasar framework's BEX mode. In the app part (popup window), I have a TypeScript file which contains some common funct

Rename key of typescript object type

I have this: type Two = { one: number, two: string, three: boolean } I want it to create a type that would look like this: type RenamedTwo = { one:

how to use multiple tsconfig files (with conflicting compiler options)?

My codebase contains two typescript projects: for a react web app for web workers The web worker codebase is part of my public/ folder. Which means that there

Cannot read property 'setProperty' of undefined fxFlex issue with ng-container Angular 9 Flex Layout

<div [fxLayout]="fields.layoutConfig.layoutDirection + ' wrap'" fxLayout.xs="column" [fxLayoutGap]="fields.layoutConfig.fxLayoutGap"> <ng-cont

How to use document.getElementById() method in TypeScript?

I am trying to reset HTML Form in order to clear all the values in the input fields using; document.getElementById('myForm').reset(); But I can use that in

How can I use moment.js to add days, excluding weekends?

I'm setting a default follow-up date two days from current date, which currently works: const Notify = moment().add(2, 'days').toDate(); However, I would lik

Bootstrap modal opens on background (Angular)

I have modal that I open from the table, that in the material tab Here is Modal HTML <div bsModal #createOrEditModal="bs-modal" class="moda

How does one add one's own bespoke inputComponent JSX <input /> to a react-phone-number-input PhoneInput?

Code follows this description. react-phone-number-input allows uses to replace its default <input /> JSX tag with one's own, which specifically requires t

Does TypeScript support constructor with object initializer?

For example, in c#, we have this snippet: class OrderLine { public OrderLine(){ OrderId ="1", ItemTitle ="2" Console.W

Using an imported type in JSDoc @typedef

I'm trying to reduce duplication in specifying my imported types as follows but I'm getting an error /** @typedef {import("../types/util")} util @typedef {util.