-
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.
-
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
-
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.
-
Which built-in filter is used for formatting dates in AngularJS?
- A) date
- B) formatDate
- C) dateFormat
- D) formatDate
Answer: A) date
-
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.
-
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.
-
Which AngularJS service is used for localization and internationalization of applications?
- A) $localize
- B) $translate
- C) $i18n
- D) $locale
Answer: B) $translate
-
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.
-
Which AngularJS service is used for managing browser history?
- A) $location
- B) $browser
- C) $route
- D) $history
Answer: A) $location
-
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