0 votes
ago in Education by (321k points)
Top 30+ Angular - Routes and Forms Interview questions and answers

1 Answer

0 votes
ago by (321k points)

Quiz On Dependency Injection

Angular - Routes and Forms Fresco Play MCQs Answers

1.Which of the following provides data to components?

1. Pipes

2. Attributes

3. Services

4. Decorators

Answer: 3)Services

[email protected] decorator is used to create a new service.

  1. True
  2. False

Answer: 2)False

3.Service is a _______________.

  1. Function
  2. Dependency Injection
  3. Class
  4. Decorator

Answer: 3)Class

4.You define Service in __________.

  1. Decorator
  2. Component
  3. Constructor
  4. Class

Answer: 3)Constructor

5.Which of the following creates new services required by the applications?

  1. Injectable
  2. Component
  3. Dependency Injection
  4. Providers

Answer: 4)Providers

Quiz On HTTP

1.The observable returns a single object alone in an HTTP request.

  1. False
  2. True

Answer: 2)True

2.An observable can handle multiple events.

  1. False
  2. True

Answer: 2)True

3.Promise returns single value when called.

  1. False
  2. True

Answer: 2)True

4.The PATCH method is used when sending passwords or other sensitive information.

  1. False
  2. True

Answer: 2)True

5.In an HTTP call, from where is the data fetched?

  1. API
  2. Component
  3. @Input
  4. Service

Answer: 1)API

Routing

1.Router defines mapping of URL to ______________.

  1. Directive
  2. Component
  3. Pipes
  4. HTML page

Answer: 2)Component

2.Which mechanism allows the user to navigate between components/views?

  1. Routing
  2. HTTP request
  3. Services
  4. Dependency Injection

Answer: 1)Routing

3.EventEmitter is a ________ defined in @angular/core module to emit custom events.

  1. Service
  2. Class
  3. Module
  4. Method

Answer: 2)Class

4.Which property of Routes defines the path of the component?

  1. path
  2. ****
  3. url
  4. src

Answer: 1)path

5.Which of the following is affected/changed on loading components?

  1. Observable
  2. URL
  3. Attribute Directive
  4. Structural Directive

Answer: 2)URL

6.The following are router guard types, except _________.

  1. CanActivateChild
  2. CanDeactivate
  3. CanDeactivateChild
  4. CanActivate

Answer: 3)CanDeactivateChild

Quiz On Forms

1.Which function bootstraps the form to its pristine state?

  1. ngSubmit
  2. bootstrap
  3. reset
  4. next

Answer: 3)reset

2.You can prevent Angular2 from auto-validating the form by using _______.

  1. validate=”manual”
  2. form.novalidate
  3. novalidate
  4. validate=”disabled”

Answer: 3)novalidate

3.In Reactive forms, the HTML of the forms is automatically created.

  1. True
  2. False

Answer: 2)False

4.Which of the following will be true if the user changed the value of control?

  1. valid
  2. dirty
  3. touched
  4. Pristine

Answer: 2)dirty

5.FormGroups can nest inside other FormGroups.

  1. False
  2. True

Answer: 2)True

Angular 2 Routes and Forms - Final Assessment

1.Which property describes the path you want to redirect the user?

  1. src
  2. ****
  3. None of the options
  4. redirectTo

Answer: 4)redirectTo

2.You add novalidate attribute to a form to prevent the browser from automatically validating.

  1. True
  2. False

Answer: 1)True

3._____________ acts as a container to store all the services required for creating a component.

  1. imports
  2. registerable
  3. providers
  4. injectables

Answer: 3)providers

4.The following are operators of observables, except ________.

  1. filter
  2. reduce
  3. map
  4. geo

Answer: 4)geo

5.Which decorator is optional if the class has any other decorator?

  1. @output
  2. @injectable
  3. @Input
  4. @component

Answer: 2)@injectable

6.You place _______________ where you want the components to be inserted.

  1. router-inlet
  2. router-outlet
  3. None of the options
  4. router-insert

Answer: 2)router-outlet

7._____________ is not a primary HTTP verb.

  1. FETCH
  2. GET
  3. POST
  4. PATCH

Answer: 1)FETCH

8._____________ decorator creates services.

  1. @output
  2. @injectable
  3. @decorator
  4. @services

Answer: 2)@injectable

9.Non-parameterized routes always take priority over parameterized routes.

  1. False
  2. True

Answer: 2)True

10.A promise is cancellable.

  1. False
  2. True

Answer: 1)False

11.FormsModule is imported from @angular/_________ in Model Driven Form.

  1. None of the options
  2. forms
  3. core
  4. form

Answer: 1)None of the options

...