Angular JS MCQs with answers Page - 22

Here, you will find a collection of MCQ questions on Angular JS. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 832.27K Points
Coach

Q. How can you optimize Angular app bundle size?

  • (A) Use lazy loading
  • (B) Use AOT compilation
  • (C) Remove unused code with tree shaking
  • (D) All of the above

A

Admin • 832.27K Points
Coach

Q. What is the role of `ngOnDestroy` lifecycle hook?

  • (A) Initialize component
  • (B) Cleanup before component is destroyed
  • (C) Detect changes
  • (D) Load data

A

Admin • 832.27K Points
Coach

Q. Which Angular decorator is used to inject dependencies?

  • (A) @Input
  • (B) @Output
  • (C) @Inject
  • (D) @ViewChild

A

Admin • 832.27K Points
Coach

Q. Which Angular module should be imported to work with HTTP interceptors?

  • (A) HttpClientModule
  • (B) HttpModule
  • (C) InterceptorModule
  • (D) CoreModule

A

Admin • 832.27K Points
Coach

Q. What does the `providedIn` property in @Injectable decorator do?

  • (A) Defines where the service is available
  • (B) Defines service visibility
  • (C) Configures service lifetime
  • (D) All of the above

A

Admin • 832.27K Points
Coach

Q. Which command installs a new Angular package?

  • (A) npm ng add package-name
  • (B) ng install package-name
  • (C) ng add package-name
  • (D) npm install package-name

A

Admin • 832.27K Points
Coach

Q. How do you pass data from a parent to a child component?

  • (A) @Input() decorator
  • (B) @Output() decorator
  • (C) EventEmitter
  • (D) ViewChild

A

Admin • 832.27K Points
Coach

Q. Which decorator is used to emit events from a child component?

  • (A) @Input
  • (B) @Output
  • (C) @EventEmitter
  • (D) @Emit

A

Admin • 832.27K Points
Coach

Q. Which lifecycle hook is called after Angular has initialized all data-bound properties?

  • (A) ngOnInit
  • (B) ngAfterViewInit
  • (C) ngOnChanges
  • (D) ngDoCheck

A

Admin • 832.27K Points
Coach

Q. What is Dependency Injection in Angular?

  • (A) Manual creation of service instances
  • (B) A design pattern to supply dependencies automatically
  • (C) Directly importing modules
  • (D) Using static variables

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ