- What is AngularJS?
a) A server-side language
b) A database management system
c) A front-end web application framework
Answer: c) A front-end web application framework
- What are directives in AngularJS?
a) A set of rules
b) A schema
c) Extensions to HTML with new attributes and elements
Answer: c) Extensions to HTML with new attributes and elements
- What is data binding in AngularJS?
a) An algorithm to compress data
b) Synchronizing data between model and view
c) Caching data for faster retrieval
Answer: b) Synchronizing data between model and view
- What is the purpose of ng-app directive in AngularJS?
a) To define the root element of an application
b) To define the ng-model attribute
c) To define a dependency injection
Answer: a) To define the root element of an application
- What is AngularJS Expression?
a) Combination of Variables, Operators, and Literals
b) An AngularJS module
c) An AngularJS template
Answer: a) Combination of Variables, Operators, and Literals
- What is $scope in AngularJS?
a) A predefined AngularJS object
b) A global variable
c) A local variable
Answer: a) A predefined AngularJS object
- What is a service in AngularJS?
a) A reusable business logic
b) A web page
c) A Java program
Answer: a) A reusable business logic
- Which built-in directive is used to loop through an array or object in AngularJS?
a) ng-repeat
b) ng-click
c) ng-class
Answer: a) ng-repeat
- What is the use of ng-model directive in AngularJS?
a) To define a model property
b) To bind HTML elements to a model
c) To define a function
Answer: b) To bind HTML elements to a model
- What is the use of ng-show directive in AngularJS?
a) To show or hide HTML elements based on an expression
b) To define a model property
c) To define a function
Answer: a) To show or hide HTML elements based on an expression
- What is the difference between one-way data binding and two-way data binding in AngularJS?
a) One-way data binding updates the model and the view, while two-way data binding only updates the model.
b) One-way data binding updates the model only, while two-way data binding updates the model and the view.
c) One-way data binding updates the view only, while two-way data binding updates the model and the view.
Answer: b) One-way data binding updates the model only, while two-way data binding updates the model and the view.
- What is $rootScope in AngularJS?
a) A scope that is shared by all controllers in an application
b) A scope that is isolated from all other scopes
c) A scope that is only accessible from a specific controller
Answer: a) A scope that is shared by all controllers in an application
- What is a module in AngularJS?
a) A function that returns an object
b) A JavaScript file
c) A predefined object in AngularJS
Answer: a) A function that returns an object
- What is the difference between $http and $resource in AngularJS?
a) $http is used for read-only data, while $resource is used for both read and write operations.
b) $http is used for both read and write operations, while $resource is used for read-only data.
c) $http and $resource are identical in functionality.
Answer: a) $http is used for read-only data, while $resource is used for both read and write operations.
- What is dependency injection in AngularJS?
a) A way of passing dependencies to a function
b) A way of injecting dependencies into a controller
c) A way of defining dependencies in a module
Answer: a) A way of passing dependencies to a function
- What is the use of ng-model-options directive in AngularJS?
a) To define options for ng-model directive
b) To define options for ng-repeat directive
c) To define options for ng-show directive
Answer: a) To define options for ng-model directive
- What is the difference between ng-if and ng-show in AngularJS?
a) ng-if removes the element from the DOM, while ng-show hides the element.
b) ng-show removes the element from the DOM, while ng-if hides the element.
c) ng-if and ng-show are identical in functionality.
Answer: a) ng-if removes the element from the DOM, while ng-show hides the element.
- What is the use of $q service in AngularJS?
a) To create promises
b) To create controllers
c) To create directives
Answer: a) To create promises
- What is the use of dependency injection in AngularJS?
a) To decouple modules from each other
b) To couple modules together
c) To reduce the size of modules
Answer: a) To decouple modules from each other
- What is angular.bootstrap() method in AngularJS?
a) A method to manually bootstrap an AngularJS application
b) A method to define a controller
c) A method to define a dependency injection
Answer: a) A method to manually bootstrap an AngularJS application
- What is the use of ng-options in AngularJS?
a) To bind a drop-down list to a model
b) To define options for ng-if directive
c) To define options for ng-show directive
Answer: a) To bind a drop-down list to a model
- Which built-in directive is used to bind HTML content in AngularJS?
a) ng-bind
b) ng-model
c) ng-repeat
Answer: a) ng-bind
- What is $http service in AngularJS?
a) A service to make HTTP requests
b) A service to create controllers
c) A service to create directives
Answer: a) A service to make HTTP requests
- What is AngularJS filter?
a) A piece of code that transforms the data
b) A part of an AngularJS module
c) A type of HTML template
Answer: a) A piece of code that transforms the data
- What is the use of ng-submit directive in AngularJS?
a) To define a model property
b) To bind HTML elements to a model
c) To handle form submission
Answer: c) To handle form submission
- What is the use of $routeParams service in AngularJS?
a) To get the value of route parameters
b) To create a new route
c) To define a dependency injection
Answer: a) To get the value of route parameters
- What is the use of ng-mouseover directive in AngularJS?
a) To handle mouse hover event
b) To handle mouse click event
c) To handle mouse wheel event
Answer: a) To handle mouse hover event
- What is the use of ng-blur directive in AngularJS?
a) To bind HTML elements
b) To handle button press event
c) To handle input element losing focus
Answer: c) To handle input element losing focus
- What is the use of ng-style directive in AngularJS?
a) To define a model property
b) To bind HTML elements to a model
c) To set CSS styles dynamically
Answer: c) To set CSS styles dynamically
- What is the use of ng-cloak directive in AngularJS?
a) To set styles for elements that have not been loaded yet
b) To hide elements that have not been loaded yet
c) To prevent elements from flashing before the AngularJS application is fully loaded
Answer: c) To prevent elements from flashing before the AngularJS application is fully loaded
- What is the use of $rootScope.$broadcast() method in AngularJS?
a) To broadcast an event to all child scopes
b) To broadcast an event to all parent scopes
c) To broadcast an event to a specific scope
Answer: a) To broadcast an event to all child scopes
- What is $location service in AngularJS?
a) A service to manipulate the URL
b) A service to create controllers
c) A service to create directives
Answer: a) A service to manipulate the URL
- What is the use of ng-bind-html directive in AngularJS?
a) To bind text content to HTML
b) To bind HTML content to a model
c) To bind HTML content to HTML
Answer: b) To bind HTML content to a model
- What is the use of angular.module() method in AngularJS?
a) To define a module
b) To define a controller
c) To define a directive
Answer: a) To define a module
- What is the purpose of ng-include directive in AngularJS?
a) To include external HTML templates to AngularJS application
b) To include JavaScript files to AngularJS application
c) To include CSS files to AngularJS application
Answer: a) To include external HTML templates to AngularJS application
- What is the use of ng-bind-template directive in AngularJS?
a) To bind text content to HTML
b) To bind HTML content to a model
c) To bind multiple expressions to a template
Answer: c) To bind multiple expressions to a template
- What is the use of ng-init directive in AngularJS?
a) To execute code when an element is initialized
b) To define a model property
c) To bind HTML elements to a model
Answer: a) To execute code when an element is initialized
- What is $routeProvider in AngularJS?
a) A service to define routes
b) A service to define controllers
c) A service to define directives
Answer: a) A service to define routes
- What is the use of ng-view directive in AngularJS?
a) To define a view template
b) To define a controller
c) To define a directive
Answer: a) To define a view template
- What is the use of ng-class directive in AngularJS?
a) To define a model property
b) To bind HTML elements to a model
c) to apply CSS classes dynamically
Answer: c) to apply CSS classes dynamically
- What is the use of $watch service in AngularJS?
a) To watch for changes in a model property
b) To create a new model property
c) To define a dependency injection
Answer: a) To watch for changes in a model property
- What is the use of ng-form directive in AngularJS?
a) To define a form element
b) To define a model property
c) To bind HTML elements to a model
Answer: a) To define a form element
- What is the use of $filter service in AngularJS?
a) To create a new filter
b) To apply a filter to an expression
c) To define a module
Answer: b) To apply a filter to an expression
- What is the use of $timeout service in AngularJS?
a) To set a timer
b) To create a controller
c) To define a directive
Answer: a) To set a timer
- What is the use of $locationProvider service in AngularJS?
a) To configure the URL routing
b) To create a new controller
c) To define a new directive
Answer: a) To configure the URL routing
- What is the use of ng-message directive in AngularJS?
a) To display error messages for form validation
b) To display success messages for form validation
c) To display warning messages for form validation
Answer: a) To display error messages for form validation
- What is the use of $httpBackend service in AngularJS?
a) To mock HTTP requests for testing purposes
b) To create a new HTTP request
c) To create a new controller
Answer: a) To mock HTTP requests for testing purposes
- What is the use of $anchorScroll service in AngularJS?
a) To scroll to a specific element in the page
b) To create a new module
c) To define a new directive
Answer: a) To scroll to a specific element in the page
- What is the use of ng-readonly directive in AngularJS?
a) To make an input element read-only
b) To make an input element writeable
c) To remove an input element
Answer: a) To make an input element read-only
- What is the use of $compile service in AngularJS?
a) To create a new directive
b) To compile HTML templates
c) To create a new filter
Answer: b) To compile HTML templates
Latest posts by Ashwani Kumar (see all)
- Top 10 DevOps Trainers in the world - October 7, 2023
- What is Cookies and Why it is Used? - May 24, 2023
- TOP trends of transitions in TikTok - May 10, 2023