-
What does ng-app directive do in AngularJS?
- A) It initializes the AngularJS application.
- B) It defines a new controller in AngularJS.
- C) It hides an element until AngularJS has finished its compilation.
- D) It specifies the root element of the AngularJS application.
Answer: D) It specifies the root element of the AngularJS application.
-
Which AngularJS service is used for managing browser history and navigation?
- A) $location
- B) $navigate
- C) $history
- D) $browser
Answer: A) $location
-
What is the purpose of ng-repeat directive in AngularJS?
- A) It initializes the AngularJS application.
- B) It defines a new controller in AngularJS.
- C) It repeats a set of HTML elements for each item in a collection.
- D) It hides an element until AngularJS has finished its compilation.
Answer: C) It repeats a set of HTML elements for each item in a collection.
-
Which AngularJS service is used for creating and managing promises?
- A) $promise
- B) $q
- C) $deferred
- D) $async
Answer: B) $q
-
What is the purpose of ng-href directive in AngularJS?
- A) It initializes the AngularJS application.
- B) It defines a new controller in AngularJS.
- C) It specifies the value of the href attribute in HTML elements.
- D) It hides an element until AngularJS has finished its compilation.
Answer: C) It specifies the value of the href attribute in HTML elements.
-
What does ng-init directive do in AngularJS?
- A) It initializes the AngularJS application.
- B) It defines a new controller in AngularJS.
- C) It initializes scope variables in the current scope.
- D) It specifies where to insert content from a transcluded directive.
Answer: C) It initializes scope variables in the current scope.
-
Which AngularJS service is used for defining routes and routing in AngularJS applications?
- A) $route
- B) $router
- C) $routeProvider
- D) $routerProvider
Answer: A) $route
-
What is the purpose of ng-cloak directive in AngularJS?
- A) It prevents AngularJS from compiling the contents of an element.
- B) It initializes the AngularJS application.
- C) It defines a new controller in AngularJS.
- D) It specifies where to render templates for different routes.
Answer: A) It prevents AngularJS from compiling the contents of an element.
-
Which AngularJS service is used for managing the application lifecycle events?
- A) $appLifecycle
- B) $rootScope
- C) $scope
- D) $lifecycle
Answer: B) $rootScope
-
What is the purpose of ng-template directive in AngularJS?
- A) It initializes the AngularJS application.
- B) It defines a new controller in AngularJS.
- C) It specifies where to render templates for different routes.
- D) It defines a template that can be reused in AngularJS applications.
Answer: D) It defines a template that can be reused in AngularJS applications.
Comments