Angular JS MCQs with answers Page - 21

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 do you protect a route using authentication guard?

  • (A) Use canActivate guard
  • (B) Use canDeactivate guard
  • (C) Use resolve guard
  • (D) Use preloadingStrategy

A

Admin • 832.27K Points
Coach

Q. Which Angular service is used to make HTTP requests?

  • (A) Http
  • (B) HttpClient
  • (C) HttpRequest
  • (D) HttpService

A

Admin • 832.27K Points
Coach

Q. What does the AsyncPipe do?

  • (A) Converts Observable to Promise
  • (B) Subscribes to Observable and returns latest value
  • (C) Unsubscribes from Observable automatically
  • (D) Both 2 and 3

A

Admin • 832.27K Points
Coach

Q. Which decorator is used to create a directive in Angular?

  • (A) @NgModule
  • (B) @Component
  • (C) @Directive
  • (D) @Injectable

A

Admin • 832.27K Points
Coach

Q. Which Angular built-in pipe is used to format dates?

  • (A) date
  • (B) time
  • (C) datetime
  • (D) formatDate

A

Admin • 832.27K Points
Coach

Q. How do you create a custom pipe in Angular?

  • (A) Using @Pipe decorator
  • (B) Using @Directive decorator
  • (C) Using @Component decorator
  • (D) Using @Injectable decorator

A

Admin • 832.27K Points
Coach

Q. Which file typically bootstraps the Angular app?

  • (A) main.ts
  • (B) app.component.ts
  • (C) app.module.ts
  • (D) index.html

A

Admin • 832.27K Points
Coach

Q. Which decorator is used to define an Angular module?

  • (A) @NgModule
  • (B) @Component
  • (C) @Directive
  • (D) @Injectable

A

Admin • 832.27K Points
Coach

Q. What is lazy loading in Angular?

  • (A) Loading modules only when needed
  • (B) Loading all modules at app start
  • (C) Loading modules in parallel
  • (D) Loading modules via service workers

A

Admin • 832.27K Points
Coach

Q. Which Angular decorator is used to provide a service at the root level?

  • (A) @Injectable({ providedIn: 'root' })
  • (B) @Service()
  • (C) @RootService()
  • (D) @Provider()