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

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.

typescriptjavascriptangular

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 *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.

typescriptangularangular2-directivesngfor

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.

typescriptangular

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.

typescriptangularjsangular

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.

typescriptangularviewchild

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 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.

typescripthttpangular

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.

typescriptangularangular-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.

typescriptangularangular2-routing

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

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.

typescriptangularangular-components

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

Page 1 of 9 - 162 questions

PreviousNext