Create New Post

AngularJS MCQs - 3

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

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

    Answer: A) It hides an element until AngularJS has finished its compilation.

  2. Which AngularJS directive is used to loop through a collection and create a new array?

    • A) ng-for
    • B) ng-repeat
    • C) ng-loop
    • D) ng-iterate

    Answer: B) ng-repeat

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

    • A) It initializes the AngularJS application.
    • B) It initializes the scope variables.
    • C) It defines a new controller in AngularJS.
    • D) It defines a new module in AngularJS.

    Answer: B) It initializes the scope variables.

  4. Which built-in filter is used for formatting dates in AngularJS?

    • A) date
    • B) formatDate
    • C) dateFormat
    • D) formatDate

    Answer: A) date

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

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

    Answer: A) It binds a select element to a model.

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

    • A) It binds an event handler to an input element that fires when the value of the input changes.
    • B) It initializes the AngularJS application.
    • C) It hides an element until AngularJS has finished its compilation.
    • D) It defines a new controller in AngularJS.

    Answer: A) It binds an event handler to an input element that fires when the value of the input changes.

  7. Which AngularJS service is used for localization and internationalization of applications?

    • A) $localize
    • B) $translate
    • C) $i18n
    • D) $locale

    Answer: B) $translate

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

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

  9. Which AngularJS service is used for managing browser history?

    • A) $location
    • B) $browser
    • C) $route
    • D) $history

    Answer: A) $location

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

    • A) It makes an element non-editable.
    • B) It binds the readonly attribute of an element to an expression.
    • C) It hides an element until AngularJS has finished its compilation.
    • D) It defines a new controller in AngularJS.

    Answer: B) It binds the readonly attribute of an element to an expression.

Comments

Leave a Reply

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

16663