Category "typescript"

pass an array of objects to a dropdown (select) using typescript

I'm trying to pass this array of objects options = [ {label:'React', value: 'react'}, {label:'ReactNative', value: 'react-native'},

Ion-datetime min/max for hours doesn’t works

I'm trying to implement a min and max attributes for datepickers. So i have two datepickers, one for start and another for the end, both just pick hours and min

Type 'string | boolean' is not assignable to type 'never'. Type 'string' is not assignable to type 'never'

interface modal { name: string; check: boolean; } type Key = "name" | "check"; const obj: modal = fn(); function fn():any { return { name

fa-icon is not a known element in a Reusable Module

Not sure why this is happening on a reusable Module (or what Iv'e got wrong). ERROR Error: Uncaught (in promise): Error: Template parse errors:'fa-icon' i

Getting ReactJS/TypeScript to work with new clean MVC5 project

I've already tried nearly all available tutorials to get a simple MVC5 project to run using TypeScript and ReactJS. Note: I've created the projects from scratch

Primeng expandable column headers don't show

I have an expandable row in Angular2 using Primeng2 but the column headers for the expandable columns aren't showing. This is my table with the expandable rows

Compare value inside of use-deep-compare-effect

This is a part of use-deep-compare-effect source code export function useDeepCompareMemoize<T>(value: T) { const ref = React.useRef<T>(value) co

Testing private method using spyOn and Jest

My functions in Calculator class is private and I can't test in this way, describe('calculate', function() { it('add', function() { let result = Calculat

Angular 2 and browser autofill

I'm implementing login page with Angular reactive forms. Button "login" is disabled if form is invalid. import { Component, OnInit } from '@angular/core'; impo

trying to run an generate art configuration in metaplex and it keeps returning this. I have tried changing up just about everything

desktop % ts-node ./metaplex/js/packages/cli/src/candy-machine-v2-cli.ts generate_art_configuration traits /usr/local/lib/node_modules/ts-node/src/index.ts:820

Angular click debounce

In my template I have a field and two buttons: <div class="btn-plus" (click)="add(1)"> - </div> <div class="txt"> {{ myValue }} </div>

Search an array list inside another array and return a new object combined

I am using typescript and I have two objects: export interface Module { moduleId: String name: String } export interface Model { id: number name

TypeScript tsc type check with references in monorepos

I'm using Yarn Workspaces, and I want a cli-command to check the types of my source ts files located at packages/*. Originally I build my project by using webpa

Storybook error when using Webpack5 with Next.JS app + Typescript

I am trying to set up a fresh next.js app using Typescript and Storybook. Following some guides online gets me fairly close but I note that the rendered 'HomePa

How to create reusable toastService with primeVue toast?

I want to know if there's a way to create a reusable scritp/class/service with primevue toast function calls, in such a way that I don't need to call the primev

Where does the lib come from in typecsript?

I have a typescript@2 project. I wanted to use some ecma2017 features. I found out that one can apply a lib in the compilerOptions in the tsconfig.json: "targe

Javascript video pause is not a function

So I'm having a little trouble with videos, i have a website and there i have the same video displayed in 3 different pages. The videos are all paused until th

TypeScript: Generic extends object with only optional keys

I have a function with overload export function someFunc<P extends undefined>(): () => string export function someFunc<P extends object>(): (pa

How to intercept back button in a React SPA using function components and React Router v5

I'm working in a SPA in React that doesn't use React Router to create any Routes; I don't need to allow users to navigate to specific pages. (Think multi-page q

Do I have to unsubscribe from ActivatedRoute (e.g. params) observables?

I find many examples where ActivatedRoute Observables like params or url are subscribed but not unsubscribed. constructor(private route: ActivatedRoute) {} ng