Difficult AngularJS Interview Preparation Guide
Download PDF

Sizzle Selector Engine job test questions and answers guide. The one who provides the best answers with a perfect presentation is the one who wins the job hunting race. Learn Sizzle JQuery Engine and get preparation for the new job

57 AngularJS Questions and Answers:

Table of Contents:

Difficult  AngularJS Job Interview Questions and Answers
Difficult AngularJS Job Interview Questions and Answers

1 :: What are the concept of scope hierarchy? Tell me how many scope can an application have?

Each angular application consist of one root scope but may have several child scopes. As child controllers and some directives create new child scopes, application can have multiple scopes. When new scopes are formed or created they are added as a children of their parent scope. Similar to DOM, they also creates a hierarchical structure.

2 :: Can you please explain the difference between angular.js and backbone.js?

Angular.js combines the functionalities of most of the 3rd party libraries, it supports individual functionalities required to develop HTML5 Apps. While Backbone.js do their jobs individually.

3 :: What are the advantages of using Angular.js framework?

Advantages of using Angular.js as framework are:

► Supports two way data-binding
► Supports MVC pattern
► Support static template and angular template
► Can add custom directive
► Supports REST full services
► Supports form validations
► Support both client and server communication
► Support dependency injection
► Applying Animations
► Event Handlers

4 :: How an object or function can get a hold of its dependencies?

These are the ways that object uses to hold of its dependencies

► Typically using the new operator, dependency can be created.
► By referring to a global variable, dependency can be looked up.
► Dependency can be passed into where it is required.

5 :: What is dependency injection in AngularJS?

DI or Dependency Injection is a software design pattern that deals with how code gets hold of its dependencies. In order to retrieve elements of the application which is required to be configured when module gets loaded , the operation "config" uses dependency injection.

6 :: What are the characteristics of "Scope"?

► To observer model mutations scopes provide APIs ($watch).
► To propagate any model changes through the system into the view from outside of the Angular realm.
► A scope inherits properties from its parent scope, while providing access to shared model properties, scopes can be nested to isolate application components.
► Scope provides context against which expressions are evaluated.

7 :: What are the styling form that ngModel adds to CSS classes?

ngModel adds these CSS classes to allow styling of form as well as control:

► ng- valid
► ng- invalid
► ng-pristine
► ng-dirty

8 :: What is factory method in angular.js?

For creating the directive, factory method is used. It is invoked only once, when compiler matches the directive for the first time. By using $injector.invoke the factory method is invoked.
It is used for registering DOM listeners as well as instance DOM manipulation. It is executed once the template has been cloned.

10 :: What is Compile function in AngularJS?

It is used for template DOM Manipulation and collect all of the directives.

11 :: What is Post linking function in AngularJS?

Post linking function is executed after the child elements are linked. It is safe to do DOM transformation by post-linking function.

12 :: What is Pre-linking function in AngularJS?

Pre-linking function is executed before the child elements are linked. It is not considered as the safe way for DOM transformation.

13 :: What is linking function?

Link combines the directives with a scope and produce a live view. For registering DOM listeners as well as updating the DOM, link function is responsible. After the template is cloned it is executed.

14 :: On what steps for the compilation process of HTML happens?

Compilation of HTML process occurs in following ways:

► Using the standard browser API, first the HTML is parsed into DOM
► By using the call to the $compile () method, compilation of the DOM is performed. The method traverses the DOM and matches the directives.
► Link the template with scope by calling the linking function returned from the previous step

15 :: What is string interpolation in angular.js?

In angular.js the compiler during the compilation process matches text and attributes using interpolate service to see if they contains embedded expressions. As part of normal digest cycle these expressions are updated and registered as watches.

16 :: What is "no initilization code" in AngularJS?

With angular.js you can bootstrap your app easily using services, which auto-injected into your application in Guice like dependency injection style.

17 :: What is "Transfer data to and from the UI" in AngularJS?

Angular.js helps to eliminate almost all of the boiler plate like validating the form, displaying validation errors, returning to an internal model and so on which occurs due to flow of marshalling data.

18 :: What is "control HTML DOM programmatically" in AngularJS?

All the application that are created using Angular never have to manipulate the DOM although it can be done if it is required.

19 :: What is registering callbacks in AngularJS?

There is no need to register callbacks . This makes your code simple and easy to debug.

20 :: What is data binding in Angular.js?

Automatic synchronization of data between the model and view components is referred as data binding in Angular.js.
There are two ways for data binding:

► Data mining in classical template systems
► Data binding in angular templates

21 :: What Angular JS routes does?

Angular js routes enable you to create different URLs for different content in your application. Different URLs for different content enables user to bookmark URLs to specific content. Each such bookmarkable URL in Angular.js is called a route
A value in Angular JS is a simple object. It can be a number, string or JavaScript object. Values are typically used as configuration injected into factories, services or controllers. A value should be belong to an Angular.js module.
Injecting a value into an Angular.js controller function is done by adding a parameter with the same name as the value.

22 :: Tell me with options on page load how you can initialize a select box?

You can initialize a select box with options on page load by using ng-init directive

► <div ng-controller = " apps/dashboard/account " ng-switch
► On = "! ! accounts" ng-init = " loadData ( ) ">

23 :: What is "No Control Flow Statements" in AngularJS?

Loops, conditionals or exceptions cannot be used in an angular expression.

24 :: What is Forgiving in AngularJS?

In Angular expression evaluation is forgiving to null and undefined, while in Javascript undefined properties generates TypeError or ReferenceError.

25 :: What are the advantages of using Angular.js?

Angular.js has several advantages in web development:

► Angular.js supports MVS pattern
► Can do two ways data binding using Angular.js
► It has per-defined form validations
► It supports both client server communication
► It supports animations
AngularJS Interview Questions and Answers
57 AngularJS Interview Questions and Answers