Questions

TypeScript questions

Choose a question page, learn the concept, then test your understanding with a quiz.

@Directive vs @Component in Angular: Differences, Use Cases, and When to Use Each

Learn the difference between @Directive and @Component in Angular, including use cases, examples, and when to choose each.

typescriptangular

Angular (change) vs (ngModelChange): What’s the Difference?

Learn the difference between Angular (change) and (ngModelChange), when each fires, and which one to use in forms and inputs.

typescriptjavascripthtmlangular

Angular @ViewChild Returning Undefined: Lifecycle, Child Components, and Fixes

Learn why Angular @ViewChild can be undefined, when it becomes available, and how to access child components correctly using lifecycle hooks.

typescriptangular

Angular Dependency Injection: Fix "Can't Resolve All Parameters for Component" Errors

Learn why Angular shows "Can't resolve all parameters for component" and how to fix service injection issues in components.

typescriptangulardependency-injection

Angular Dependency Injection: Fixing 'No Provider for NameService'

Learn why Angular shows 'No provider for NameService' and how to register and inject services correctly in Angular components.

typescriptangularsystemjs

Angular ExpressionChangedAfterItHasBeenCheckedError Explained

Learn why Angular throws ExpressionChangedAfterItHasBeenCheckedError and how lifecycle hooks and change detection cause it.

typescriptangular

Angular Scroll to Top on Route Change: Router Events and Scroll Position

Learn how to scroll to the top on Angular route changes using Router events and built-in scroll restoration options.

typescriptangularangular2-routingangular2-template

Angular formControl Error with Material Autocomplete: Why It Happens and How to Fix It

Learn why Angular says it cannot bind to formControl and how to fix Reactive Forms setup with Angular Material Autocomplete.

typescriptangularangular-material2angular-forms

Angular formGroup Error Explained: Fixing 'Can't bind to formGroup' in Reactive Forms

Learn why Angular shows 'Can't bind to formGroup' and how to fix it by importing ReactiveFormsModule correctly.

typescriptangularangular2-forms

Array<Type> vs Type[] in TypeScript Explained

Learn the difference between Array<Type> and Type[] in TypeScript, when they are equivalent, and which style to use in real code.

typescript

Can You Override an Interface Property Type in TypeScript Declaration Files?

Learn whether you can change an interface property type from a .d.ts file in TypeScript, and what safe alternatives to use instead.

typescriptjavascripttypescript-typings

Difference Between .ts and .tsx in React TypeScript

Learn when to use .ts vs .tsx in React TypeScript projects, with examples, common mistakes, and practical usage patterns.

typescriptreactjs

Filter Null and Undefined from Arrays in TypeScript

Learn how to filter null values from arrays in TypeScript with strictNullChecks using type guards and get a safe string[] result.

typescriptnull

Fix "Element implicitly has an 'any' type" in TypeScript Object Indexing

Learn why TypeScript rejects string object indexing and how to fix it with keyof, unions, and typed object keys in React.

typescript

Fix "Property has no initializer" in Angular TypeScript Components

Learn why Angular TypeScript shows "Property has no initializer" and how to fix it using defaults, optional properties, or definite assignment.

typescriptangular

Fix 'Could not find a declaration file for module' in TypeScript

Learn why TypeScript cannot find declaration files for a package and how to fix it with types, package.json, and module resolution.

typescriptnode-modules

Fix TS2304 Cannot Find Name 'require' in TypeScript for Node.js

Learn why TypeScript shows TS2304 for 'require' in Node.js and how to fix it using Node type definitions and correct project setup.

typescriptnode.jsdefinitelytyped

Fixing React State Updates on Unmounted Components

Learn why React warns about state updates on unmounted components and how to prevent async, throttled, and subscription leaks.

typescriptjavascriptreactjslodash

Fixing Type 'string' Is Not Assignable to Type in TypeScript Union Types

Learn why TypeScript rejects string to literal union assignments and how to safely use custom types like Fruit.

typescriptjavascript

Generate Components in a Specific Folder with Angular CLI

Learn how to generate Angular components in a specific folder using Angular CLI, including child components and project structure tips.

typescriptangularangular-cli

Page 1 of 6 - 112 questions

PreviousNext