πŸ“Š Angular
Q. What does Angular use for dependency injection?
  • (A) Injector class
  • (B) Service class
  • (C) DI container
  • (D) Zone.js
πŸ’¬ Discuss
βœ… Correct Answer: (A) Injector class

Explanation: Angular uses the Injector class to inject dependencies.

πŸ“Š Angular
Q. Which decorator is used to emit events to parent components?
  • (A) @Input
  • (B) @Output
  • (C) @Injectable
  • (D) @NgModule
πŸ’¬ Discuss
βœ… Correct Answer: (B) @Output

Explanation: @Output is used to emit custom events to parent components.

πŸ“Š Angular
Q. What symbol is used to denote event binding?
  • (A) []
  • (B) ()
  • (C) [()]
  • (D) {}
πŸ’¬ Discuss
βœ… Correct Answer: (B) ()

Explanation: Parentheses () are used for event binding in Angular.

πŸ“Š Angular
Q. Which concept ensures code modularity in Angular?
  • (A) Components
  • (B) Modules
  • (C) Directives
  • (D) Pipes
πŸ’¬ Discuss
βœ… Correct Answer: (B) Modules

Explanation: Modules group related code and ensure modular architecture.

πŸ“Š Angular
Q. How is the root component of Angular app identified?
  • (A) It uses @NgModule
  • (B) It is declared in main.ts
  • (C) It is listed in bootstrap array in AppModule
  • (D) It is named root.component.ts
πŸ’¬ Discuss
βœ… Correct Answer: (C) It is listed in bootstrap array in AppModule

Explanation: The root component is listed in the bootstrap array of AppModule.

πŸ“Š Angular
Q. What does `ngOnChanges` do?
  • (A) Executes when the app starts
  • (B) Executes when input properties change
  • (C) Executes when the view is initialized
  • (D) Executes when the component is destroyed
πŸ’¬ Discuss
βœ… Correct Answer: (B) Executes when input properties change

Explanation: ngOnChanges is triggered when input property values change.

πŸ“Š Angular
Q. What is Zone.js used for in Angular?
  • (A) Routing
  • (B) HTTP Requests
  • (C) Change detection
  • (D) State management
πŸ’¬ Discuss
βœ… Correct Answer: (C) Change detection

Explanation: Zone.js is used to detect changes and trigger Angular's change detection.

πŸ“Š Angular
Q. Which Angular feature helps to lazy load modules?
  • (A) PreloadingStrategy
  • (B) Route Guards
  • (C) loadChildren
  • (D) NgSwitch
πŸ’¬ Discuss
βœ… Correct Answer: (C) loadChildren

Explanation: loadChildren enables lazy loading of Angular modules.

πŸ“Š Angular
Q. Which Angular service handles navigation between views?
  • (A) ViewService
  • (B) HttpClient
  • (C) Router
  • (D) NavigationService
πŸ’¬ Discuss
βœ… Correct Answer: (C) Router

Explanation: Angular's Router service handles navigation and routing.

πŸ“Š Angular
Q. Which strategy improves Angular app performance by reducing change detection cycles?
  • (A) Default strategy
  • (B) Manual rendering
  • (C) OnPush strategy
  • (D) Detached strategy
πŸ’¬ Discuss
βœ… Correct Answer: (C) OnPush strategy

Explanation: OnPush change detection strategy improves performance by checking only when inputs change.