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.
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.
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.
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.
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.
Angular ExpressionChangedAfterItHasBeenCheckedError Explained
Learn why Angular throws ExpressionChangedAfterItHasBeenCheckedError and how lifecycle hooks and change detection cause it.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Page 1 of 6 - 112 questions