Create New Post

AngularJS MCQs - 4

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

    • A) It binds CSS classes to HTML elements based on expression evaluation.
    • 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 CSS classes to HTML elements based on expression evaluation.

  2. Which AngularJS service is used for browser cookies manipulation?

    • A) $cookies
    • B) $cookieStore
    • C) $browser
    • D) $cookie

    Answer: A) $cookies

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

    • A) It hides an HTML element.
    • B) It initializes the AngularJS application.
    • C) It defines a new controller in AngularJS.
    • D) It binds CSS classes to HTML elements based on expression evaluation.

    Answer: A) It hides an HTML element.

  4. Which AngularJS service is used for broadcasting events to child scopes?

    • A) $broadcast
    • B) $emit
    • C) $on
    • D) $watch

    Answer: A) $broadcast

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

    • A) It binds the checked 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 checked state of an input element to an expression.

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

    • A) It disables an HTML element.
    • B) It initializes the AngularJS application.
    • C) It defines a new controller in AngularJS.
    • D) It binds the disabled state of an input element to an expression.

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

  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 *

42537