Q. Which RxJS operator is used to transform emitted values?

  • (A) filter
  • (B) map
  • (C) take
  • (D) merge
πŸ’¬ Discuss
βœ… Correct Answer: (B) map
Explanation: The `map` operator transforms each value emitted by an Observable.

Q. Which RxJS operator combines multiple Observables into one by emitting all values?

  • (A) combineLatest
  • (B) merge
  • (C) switchMap
  • (D) concat
πŸ’¬ Discuss
βœ… Correct Answer: (B) merge
Explanation: `merge` subscribes to multiple Observables and emits their values concurrently.

Q. Which RxJS operator cancels previous Observable when a new one is emitted?

  • (A) mergeMap
  • (B) concatMap
  • (C) switchMap
  • (D) flatMap
πŸ’¬ Discuss
βœ… Correct Answer: (C) switchMap
Explanation: `switchMap` cancels the previous inner Observable when a new one is emitted.

Q. Which RxJS operator limits the number of emissions?

  • (A) take
  • (B) skip
  • (C) debounceTime
  • (D) distinctUntilChanged
πŸ’¬ Discuss
βœ… Correct Answer: (A) take
Explanation: `take` limits the number of values emitted by the source Observable.

Q. Which decorator is used to inject dependencies in Angular?

  • (A) @Inject
  • (B) @Injectable
  • (C) @Input
  • (D) @Component
πŸ’¬ Discuss
βœ… Correct Answer: (B) @Injectable
Explanation: @Injectable marks a class as available to be injected as a dependency.

Q. Which routing guard is used to prevent navigation to a route?

  • (A) CanLoad
  • (B) CanActivate
  • (C) Resolve
  • (D) Deactivate
πŸ’¬ Discuss
βœ… Correct Answer: (B) CanActivate
Explanation: CanActivate determines if a route can be accessed.

Q. Which guard checks before unloading a component?

  • (A) CanActivate
  • (B) CanLoad
  • (C) CanDeactivate
  • (D) Resolve
πŸ’¬ Discuss
βœ… Correct Answer: (C) CanDeactivate
Explanation: CanDeactivate is used to prevent users from leaving a component, e.g., with unsaved changes.

Q. Which command generates a new guard in Angular CLI?

  • (A) ng generate component
  • (B) ng generate guard
  • (C) ng guard
  • (D) ng add guard
πŸ’¬ Discuss
βœ… Correct Answer: (B) ng generate guard
Explanation: `ng generate guard` creates a new route guard in Angular.

Q. Which function is used to create route animations?

  • (A) state()
  • (B) trigger()
  • (C) transition()
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above
Explanation: state(), trigger(), and transition() are used together to create Angular animations.

Q. Which Angular package supports internationalization?

  • (A) @angular/common/http
  • (B) @angular/forms
  • (C) @angular/localize
  • (D) @angular/compiler
πŸ’¬ Discuss
βœ… Correct Answer: (C) @angular/localize
Explanation: @angular/localize provides APIs and tools for internationalization (i18n).