-
Which directive is used to include external HTML templates in AngularJS?
- A) ng-include
- B) ng-template
- C) ng-html
- D) ng-external
Answer: A) ng-include
-
What does $routeProvider do in AngularJS?
- A) It defines routes for navigation in the application.
- B) It provides access to route parameters.
- C) It defines controllers for different routes.
- D) It initializes the AngularJS application.
Answer: A) It defines routes for navigation in the application.
-
Which AngularJS directive is used to handle events?
- A) ng-click
- B) ng-model
- C) ng-show
- D) ng-bind
Answer: A) ng-click
-
What is the purpose of ng-disabled directive in AngularJS?
- A) It disables data binding for an element.
- B) It disables input fields in a form.
- C) It disables event handling for an element.
- D) It disables an HTML element based on an expression.
Answer: D) It disables an HTML element based on an expression.
-
Which built-in filter is used for filtering items in an array based on a search criteria?
- A) filter
- B) search
- C) find
- D) match
Answer: A) filter
-
What is the purpose of $rootScope in AngularJS?
- A) It represents the root scope of the application.
- B) It represents the scope of a specific controller.
- C) It represents the scope of a specific directive.
- D) It represents the scope of a specific service.
Answer: A) It represents the root scope of the application.
-
Which directive is used to bind HTML content to an AngularJS expression securely?
- A) ng-bind-html
- B) ng-html-bind
- C) ng-secure-bind
- D) ng-html-bind-secure
Answer: A) ng-bind-html
-
What is the purpose of ng-submit directive in AngularJS?
- A) It binds a form submission event to a function.
- B) It disables form submission.
- C) It initializes form validation.
- D) It submits a form automatically.
Answer: A) It binds a form submission event to a function.
-
Which AngularJS service is used for communicating between components in AngularJS applications?
- A) $rootScope
- B) $broadcast
- C) $emit
- D) $scope
Answer: B) $broadcast
-
What does $q service provide in AngularJS?
- A) It provides methods for making HTTP requests.
- B) It provides methods for managing promises.
- C) It provides methods for routing in the application.
- D) It provides methods for animation.
Answer: B) It provides methods for managing promises.
Comments