Exception: Can't bind to 'ngFor' since it isn't a known native property

What am I doing wrong? import {bootstrap, Component} from 'angular2/angular2' @Component({ selector: 'conf-talks', template: `<div *ngFor="talk of talks"> {{talk.title}} by...

Angular2 Wait DOM element to load

I have Component which has a member array variable. This array is bind to DOM with *ngFor. When I add new variable to array my view changes accordingly. Array holds tab names and initially it is...

Typescript multiple inheritance

I'm need of multiple inheritance in typescript. Logically it is not good to put a lot of functionality to hierarchy. I have one base class and number of hierarchy branches. But I need somehow to...

Angular Reactive forms : how to reset form state and keep values after submit

In an Angular reactive form. How to reset only the state of form after successful submit? Here is the process: Create the form and setValue from service result Modify values and submit the...

Connecting PostgreSQL from TypeORM docker container

I am trying to connect a postgres db to nodejs using typeorm. I tried doing this with both postgres and nodejs in localhost and it worked fine. However I am having problems when I put postgres and...

ERROR TypeError: Cannot read property 'slice' of undefined---Typescript

how are you? I have one problem 'slice' of undefined in my project. I use autocomplete material https://material.angular.io/components/autocomplete/examples My code.ts //get all Country from...

What's the difference between tsc (TypeScript compiler) and ts-node?

I'm very confused about the difference between tsc and ts-node. I'm learning TypeScript and I usually transpile server .ts files with tsc command. Now, I'm approaching nestjs framework, and I see...

TypeORM lazyload update parent fails on child save

I am not sure if this is a bug, or I am doing something wrong, but I tried a lot of things to get this working and I couldn't. I hope you guys can help. Basically I have a one to one relationship...

Why is onSelectionChange called twice?

I am using Angular Material Autocomplete as follows: <mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="displayFn" autoActiveFirstOption> <mat-option *ngFor="let option of...

When does the constructor of an injected service in angular run?

In Angular 7, if we have a service declared as @Injectable({providedIn: 'root'}), when does it's constructor execute? Does it execute upon the construction of a component that uses it (as a...

Typescript: Type 'string | undefined' is not assignable to type 'string'

When I make any property of an interface optional, I get an error like the following while assigning its member to some other variable: TS2322:...

How to create a type excluding instance methods from a class in typescript?

Given a class, containing both properties and methods, I'd like to derive a type that just contains its properties. For example, if I define a class as follow: class MyObject { ...

angular Deployment issue with tomcat

I am using Angular 6 my am some getting some issue while deploy application on tomcat *i have Base href = /login/* when i go to any page like you see below forget routerlink it work but when i...

Error: InvalidPipeArgument: 'function () { return fn.apply(this, arguments); }' for pipe 'AsyncPipe' Angular 7 Unit testing

I'm writing unit test cases in Angular 7 in this process got stuck to create unit test for a service variable 'isLoading'. here is my app component html...

The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0 but 3.5.3 was found instead

I'm getting the following error when I do npm run build: The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0 but 3.5.3 was found instead. I've tried following things separately: npm...

TypeORM array is not supported in postgres?

I have a column kid_ages which is Integer[]. When migrating, I get the following error: DataTypeNotSupportedError: Data type "Array" in "home.kid_ages" is not supported by "postgres" database. I...

"parserOptions.project" has been set for @typescript-eslint/parser

I created a new React Native project with --template typescript I deleted the template directory which came as part of the boilerplate. I then proceeded to add ESLint: module.exports = { parser:...

Nest JS Cannot read property of undefined

My application was working fine, and it stopped after trying to get the documentation with swagger, i think it may be a dependency issue, but can't find it anywhere. I keep getting the...

What does {} mean in TypeScript?

I am guessing it means empty object, but not sure... I can’t find that type on https://www.typescriptlang.org/docs/handbook/basic-types.html. interface Component<P = {}, S = {}, SS = any>...

How to get static files served dynamically with Rollup (and work along with node-resolve)?

I'm making a library based on TSDX, nice and powerful CLI for package development which is based on Rollup and allows customization of its config. I have a bunch of country flags SVGs in my...

Typescript: Import type from package without dependencies from other types in the same package

I have a NPM package written in Typescript (let's call it libd) that offers some classes and types. They are exported in a index.ts file like this: export { ClassA } from "./ClassA"; export {...

Upgrade to Firebase JS 8.0.0: Attempted import error: 'app' is not exported from 'firebase/app' (imported as 'firebase')

After upgrading to 8.0.0, I get the following error: Attempted import error: 'initializeApp' is not exported from 'firebase/app' (imported as 'firebase'). My import looks like this: import * as...

Jest: Cannot find module 'monaco-editor-core'

I have an reactjs(typescript) app which uses monaco-editor-core, and not monaco-editor, with custom language. Jest tests fails, if i don't mock monaco-editor-core imports, with next error: "Cannot...

'React' is declared but its value is never read in ts 4.2

Just upgraded to typescript 4.2.2 and started receiving following warning for all my react imports i.e. import React from "react"; Causes this warning 'React' is declared but its value is never...

Angular error TS2531: Object is possibly 'null'

So I have a Component.html that includes an input as follows: <input type="text" (change) = "setNewUserName($event.target.value)"/> the component.ts is: import { Component } from...

in Typescript, try...catch error object shows "Object is of type 'unknown'.ts(2571)"

router.get('/cells', async (req, res) => { try { const result = await fs.readFile(fullPath, { encoding: 'utf-8' }); res.send(JSON.parse(result)); } catch (err) { if...

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader - Vue 3

I get the following error when i want to start my vue 3 typescript project: ERROR Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On...

Property 'exact' does not exist on type

I am trying to use react-router-dom inside my react app and also I am using typescript instead of javascript. The issue here is that I can't import Route inside my and make it work. I already...

Struggling with TypeScript, React, Eslint and simple Arrow Functions components

I have been struggling all morning with this issue and couldn't find the solution anywhere. I am new to typescript, and I am trying to set it up properly with Eslint and Prettier to ensure the...

Sharing a typescript library in a monorepo

I'm trying to setup a monorepo with 3 services sharing some library code. This is the current situation: repo: web pdf/ package.json reference to shared-ts using github url ...