Create New Post

AngularJS MCQs - 8

  1. What does ng-disabled directive do in AngularJS?

    • A) It binds the disabled state of an input element to an expression.
    • B) It initializes the AngularJS application.
    • C) It defines a new controller in AngularJS.
    • D) It hides an element until AngularJS has finished its compilation.

    Answer: A) It binds the disabled state of an input element to an expression.

  2. Which AngularJS service is used for managing client-side routing in AngularJS applications?

    • A) $route
    • B) $router
    • C) $routeProvider
    • D) $locationProvider

    Answer: A) $route

  3. What is the purpose of ng-show directive in AngularJS?

    • A) It binds an HTML element to an AngularJS expression.
    • B) It repeats a set of HTML elements for each item in a collection.
    • C) It displays or hides an HTML element based on an expression.
    • D) It disables an HTML element based on an expression.

    Answer: C) It displays or hides an HTML element based on an expression.

  4. Which AngularJS service is used for injecting dependencies into AngularJS components?

    • A) $injector
    • B) $provider
    • C) $dependency
    • D) $inject

    Answer: A) $injector

  5. What is the purpose of ng-src directive in AngularJS?

    • A) It specifies the value of the src attribute in HTML elements.
    • B) It initializes the AngularJS application.
    • C) It defines a new controller in AngularJS.
    • D) It specifies the source of an external template.

    Answer: A) It specifies the value of the src attribute in HTML elements.

  6. What does ng-keydown directive do in AngularJS?

    • A) It binds a keydown event to a function.
    • B) It initializes the AngularJS application.
    • C) It defines a new controller in AngularJS.
    • D) It hides an element until AngularJS has finished its compilation.

    Answer: A) It binds a keydown event to a function.

  7. Which AngularJS service is used for making AJAX requests and handling responses?

    • A) $http
    • B) $ajax
    • C) $request
    • D) $fetch

    Answer: A) $http

  8. What is the purpose of ng-options directive in AngularJS?

    • A) It initializes options for a select element.
    • B) It binds a select element to a model.
    • C) It initializes the AngularJS application.
    • D) It defines a new controller in AngularJS.

    Answer: A) It initializes options for a select element.

  9. Which AngularJS directive is used to dynamically load templates?

    • A) ng-template
    • B) ng-include
    • C) ng-view
    • D) ng-switch

    Answer: B) ng-include

  10. What is the purpose of ng-selected directive in AngularJS?

    • A) It binds the selected state of an option element to an expression.
    • B) It initializes the AngularJS application.
    • C) It defines a new controller in AngularJS.
    • D) It hides an element until AngularJS has finished its compilation.

    Answer: A) It binds the selected state of an option element to an expression.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

84429