• +91 9723535972
  • info@interviewmaterial.com

Angular Interview Questions and Answers

Related Subjects

Angular Interview Questions and Answers

Question - 21 : - Explain the concept of scope hierarchy

Answer - 21 : - Each angular application consists of one root scope but may have several child scopes. As child controllers and some directives create new child scopes, an application can have multiple scopes. When new scopes are formed or created, they are added as a children of their parent scope. They also create a hierarchical structure similar to DOM.

Question - 22 : - How can you integrate AngularJS with HTML?

Answer - 22 : - Developers can follow the following steps to integrate AngularJS with HTML: Step 1: including AngularJS JavaScript in html page. Step 2: Point out AngularJS application. You have to add ng-app attribute inside HTML body tag to tell what part of HTML AngularJS app has as shown in the following example:

Question - 23 : - What is orderby filter in AngularJS?

Answer - 23 : - Orderby filter in AngularJS orders the array based on specified criteria. Following example states how you can order product by price.

  • {{ company.product + ', price:' + product.price }}

Question - 24 : - What is ng-non-bindable in AngularJS?

Answer - 24 : - Ng-non-bindable specifies AngularJs to not compile the HTML element and its child nodes. For example:

Question - 25 : - Explain the use of double click event in AngularJS

Answer - 25 : - double click event of AgularJS let you to specify custom behavior on double click event of mouse on a web page like: ...

Question - 26 : - Explain ng-click directives in AngularJS with example

Answer - 26 : - Ng-click directives can be used in a scenario when you have to click on the button or want to perform any operation.

Question - 27 : - Why use ng-include in AngularJS?

Answer - 27 : - Ng-include in AngularJS helps you to embed HTML pages within a single HTML page. Example:

Question - 28 : - How can you make an ajax call using Angular JS?

Answer - 28 : - AngularJS offers $https: control that helps you to make ajax call to read server data. The server makes a database call in order to get the required records. Once your data in JSON format is ready, you can use $https: to retrieve data from the server in the following manner: function employeeController($scope,$https:) { var url = "tasks.txt"; $https.get(url).success( function(response) { $scope.employee = response; }); }

Question - 29 : - Explain the use of $routeProvider

Answer - 29 : - In Angular JS $routeProvider sets the URL configuration. It maps with the related ng-template or HTML page and attaches a controller with the same.

Question - 30 : - How can you set, get, and clear cookies in AngularJS?

Answer - 30 : - You can use: • $cookies.put() method to set the cookies. • $cookies.get() method to get the cookies. • $cookies.remove to remove cookies in AngularJS.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners