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.
Accessing Input Value from EventTarget in TypeScript
Learn why EventTarget has no value property in TypeScript and safely read values from HTML input events in Angular applications.
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 *ngFor: Fix “Can't Bind to ngFor” Errors
Learn why Angular cannot bind to ngFor, how structural directive microsyntax works, and how to import NgFor or CommonModule correctly.
Angular 5 File Upload with FormData and HttpClient
Learn how to build an Angular 5 file upload using a file input, FormData, and HttpClient, including validation and upload progress.
Angular @Input Callbacks and @Output Events
Learn how to pass callback functions to Angular child components with @Input and when to use @Output EventEmitter instead.
Angular @ViewChild Options: Fix “Expected 2 Arguments” Error
Learn why Angular @ViewChild may require an options object, how to use static correctly, and when template references are available.
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 HTTP Query Parameters: Passing URL Arguments Safely
Learn how to add URL query parameters to Angular HTTP GET requests using URLSearchParams and modern HttpParams, with examples and pitfalls.
Angular NgModule Exports: Use a Component from Another Module
Learn how Angular NgModule declarations, imports, and exports control whether a component such as TaskCardComponent is usable in another module.
Angular RouterLink Error: Import RouterModule in the Correct NgModule
Learn why Angular says routerLink is not a known property and how NgModule template scope and RouterModule imports fix header navigation.
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.
Call a Child Component Method from a Parent in Angular
Learn how Angular parents call child component methods with @ViewChild, lifecycle hooks, and template component instances.
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.
Page 1 of 9 - 162 questions