πŸ“Š Angular
Q. Which pipe is used to format currency values in Angular?
  • (A) number
  • (B) currency
  • (C) money
  • (D) cash
πŸ’¬ Discuss
βœ… Correct Answer: (B) currency

Explanation: The currency pipe is used to format numbers as currency values.

πŸ“Š Angular
Q. What is the role of HttpClient in Angular?
  • (A) To create components
  • (B) To route between pages
  • (C) To make HTTP requests
  • (D) To handle reactive forms
πŸ’¬ Discuss
βœ… Correct Answer: (C) To make HTTP requests

Explanation: HttpClient is used to make HTTP requests to servers.

πŸ“Š Angular
Q. Which directive is used to repeat a portion of HTML?
  • (A) *ngIf
  • (B) *ngSwitch
  • (C) *ngFor
  • (D) *ngRepeat
πŸ’¬ Discuss
βœ… Correct Answer: (C) *ngFor

Explanation: *ngFor is used to loop through arrays and repeat elements.

πŸ“Š Angular
Q. Which function is used to unsubscribe from an observable manually?
  • (A) close()
  • (B) unsubscribe()
  • (C) stop()
  • (D) detach()
πŸ’¬ Discuss
βœ… Correct Answer: (B) unsubscribe()

Explanation: unsubscribe() is used to stop listening to an Observable.

πŸ“Š Angular
Q. What is the use of @Injectable decorator in Angular?
  • (A) To define a pipe
  • (B) To define a component
  • (C) To define a service for dependency injection
  • (D) To define a module
πŸ’¬ Discuss
βœ… Correct Answer: (C) To define a service for dependency injection

Explanation: @Injectable marks a class as available for dependency injection.

πŸ“Š Angular
Q. Which lifecycle hook is called before Angular destroys the component?
  • (A) ngOnDestroy
  • (B) ngAfterViewInit
  • (C) ngDoCheck
  • (D) ngAfterContentInit
πŸ’¬ Discuss
βœ… Correct Answer: (A) ngOnDestroy

Explanation: ngOnDestroy is called just before Angular destroys the component.

πŸ“Š Angular
Q. Which interface is implemented to use ngOnInit?
  • (A) OnChanges
  • (B) OnDestroy
  • (C) OnInit
  • (D) DoCheck
πŸ’¬ Discuss
βœ… Correct Answer: (C) OnInit

Explanation: To use ngOnInit, a component implements the OnInit interface.

πŸ“Š Angular
Q. Which Angular concept allows sharing data between unrelated components?
  • (A) Child components
  • (B) Parent components
  • (C) Services
  • (D) Pipes
πŸ’¬ Discuss
βœ… Correct Answer: (C) Services

Explanation: Services can be used to share data between unrelated components.

πŸ“Š Angular
Q. What does 'ng' stand for in Angular CLI commands?
  • (A) Next Generation
  • (B) Angular
  • (C) Node Generator
  • (D) New Generator
πŸ’¬ Discuss
βœ… Correct Answer: (B) Angular

Explanation: 'ng' stands for Angular in CLI commands.

πŸ“Š Angular
Q. Which of the following is NOT a valid Angular directive?
  • (A) *ngIf
  • (B) *ngFor
  • (C) *ngSwitch
  • (D) *ngRepeat
πŸ’¬ Discuss
βœ… Correct Answer: (D) *ngRepeat

Explanation: *ngRepeat is from AngularJS, not Angular (2+).