Category "typescript"

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

is vue-storefront support (nuxtjs with typescript)?

I am trying to use @storefront-ui/nuxt inside a nuxtjs (with typescript) project. but this error show for me Could not find a declaration file for module '@st

How to bind an empty array to the props in Vue.js3?

<script lang="ts" setup> interface Props { bigArray: string[]; } ***const props = withDefaults(defineProps<Props>(), { big

How to reload the current route with the angular 2 router

I am using angular 2 with hashlocation strategy. The component is loaded with that route: "departments/:id/employees" So far fine. After I do a successful batc

How to define Typescript Map of key value pair. where key is a number and value is an array of objects

In my angular2 app i want to create a map which takes a number as key and returns an array of objects. I am currently implementing in following way but no luck.

Is field initialization by another field permitted?

I'm trying to do this in my class: class Foo { _errorHappened = new Subject(); errorHappened = this._errorHappened.asObservable(); } I'm using a field'

How to use nestjs Logging service

I tried to use the internal Logger of nestjs (described on https://docs.nestjs.com/techniques/logger -> but with no description of how to use it) But I had

Two way data binding in model driven forms

I have a reactive form, in which, i have a first name, a last name and finally display name textbox. When i give first name and last name, the value of the disp

VsCode clean Typescript project no auto import suggestions

When I create a new Node project using Typescript, VsCode auto import suggestions do not work at all. Steps to reproduce: Create a workspace directory. Run n

reactstrap typescript nx `Uncaught ReferenceError: global is not defined`

I'm using [email protected] with nx and typescript. But if any component is included from reactstrap the app is crashing with below error index.js:3 Uncaught Ref

Typescript Equality issue on Material UI Autocomplete

Data is stored as: { iso: "gb", label: "United Kingdom", country: "United Kingdom" }, { iso: "fr", label: "France", country: "France" } Value passed to the

AngularFireList, property valueChanges() show the error Property 'query' is missing in type 'Observable<{}[]>

I'm having a hard time to figure out this error. Here is my code that I'm building in to make a AuthGuard service: user.service.ts: import { Injectable } from