Question 1: What is the main purpose of Angular services?
- Define UI layout
- Share data and logic across components
- Handle routing only
- Manage templates
Explanation: Services are used to share reusable business logic and data.
This intermediate Angular quiz is designed for developers who already understand Angular basics and want to strengthen their real-world skills. It focuses on component communication, services, routing, forms, observables, change detection, and common interview-level scenarios.
Explanation: Services are used to share reusable business logic and data.
Explanation: @Input allows data to flow from parent to child.
Explanation: @Output emits events from child to parent.
Explanation: EventEmitter is used to emit custom events.
Explanation: Angular Router enables navigation between components.
Explanation: CanActivate controls route access.
Explanation: CanLoad stops loading of lazy modules.
Explanation: Lazy loading loads modules on demand.
Explanation: ngOnChanges runs when input values change.
Explanation: ngDoCheck allows custom change detection.
Explanation: Observables represent asynchronous data streams.
Explanation: RxJS provides Observable support.
Explanation: subscribe starts listening to emitted values.
Explanation: map transforms values in the stream.
Explanation: filter allows selective emission.
Explanation: Async pipe subscribes and unsubscribes automatically.
Explanation: Reactive forms use FormControl and FormGroup.
Explanation: ReactiveFormsModule enables reactive forms.
Explanation: Reactive forms scale better for complex logic.
Explanation: FormGroup groups multiple controls.
Explanation: Date pipe formats date values.
Explanation: Currency pipe formats monetary values.
Explanation: Custom pipes transform data for display.
Explanation: ErrorHandler handles global errors.
Explanation: Interceptors modify HTTP requests and responses.
Explanation: Interceptors commonly attach auth headers.
Explanation: Change detection updates the view on data change.
Explanation: OnPush reduces unnecessary checks.
Explanation: Angular runs change detection on async events.
Explanation: @ViewChild accesses child component references.
Explanation: ng-content projects external content.
Explanation: Directives reuse DOM behavior.
Explanation: CommonModule provides ngIf, ngFor, pipes.
Explanation: ngAfterViewInit runs after view creation.
Explanation: Resolvers fetch data before navigation.
Explanation: @Injectable enables dependency injection.
Explanation: It provides a singleton service globally.
Explanation: tsconfig.json controls TS compilation.
Explanation: trackBy reduces DOM re-rendering.
Explanation: Async pipe handles subscriptions automatically.
Explanation: Environment files manage environment-specific configs.
Explanation: --prod creates an optimized build.
Explanation: Components handle UI, services handle logic.
Explanation: Angular is designed for scalable apps.
This intermediate Angular quiz is designed for developers who already understand Angular basics and want to strengthen their real-world skills. It focuses on component communication, services, routing, forms, observables, change detection, and common interview-level scenarios.