10 Frequently Asked Angularjs Interview Questions 
Tags: angular, interview, developers, angularjobsquestions
Published: 2018-06-20 16:18:34

---
title: 10 Frequently Asked Angularjs Interview Questions 
published: true
description: These days AngularJS is one of those hot topics everyone wants to learn it because AngularJs developers are getting more paid by companies. In this article, I going to share 10 Frequently Asked Angularjs Interview Questions and answers
tags: AngularJS, Interview, Angular, developers, AngularJobsQuestions
---

These days AngularJS is one of those hot topics everyone wants to learn it because AngularJs developers are getting more paid by companies. In this article, I going to share 10 Frequently Asked Angularjs Interview Questions and answers

<h2>1. What are expressions in Angular?</h2>
AngularJs Expressions are used to bind application data to html. Expressions are written inside double braces like {{ expression}}. Expressions behave in the same way as ng-bind directives. AngularJS application expressions are pure javascript expressions and output the data where they are used.

<h2>2. Do I need Jquery for Angular?</h2>
No, you do not need Jquery for Angular. It’s independent of Jquery.

<h2>3. What are advantages of MVVM over MVC?</h2>
Below are few advantages of MVVM over MVC:-
1.Increases the “Blendability” of your views (ability to use Expression Blend to design views)
2.“Lookless” view logic
3. No duplicated code to update views
4. Testability 
5. Designer-Developer Workflow

<h2>4. Explain how $scope.$apply() works</h2>
$scope.$apply re-evaluates all the declared ng-models and applies the change to any that have been altered (i.e. assigned to a new value)
Explanation: $scope.$apply() is one of the core angular functions that should never be used explicitly, it forces the angular engine to run on all the watched variables and all external variables and apply the changes on their values

<h2>5. What is an interceptor? What are common uses of it?</h2>

An interceptor is a middleware code where all the $http requests go through.

The interceptor is a factory that are registered in $httpProvider. You have 2 types of requests that go through the interceptor, request and response (with requestError and responseErrorrespectively). This piece of code is very useful for error handling, authentication or middleware in all the requests/responses.

<h2>6. Mention what are the advantages of using AngularJS?</h2>
There are several advantages of AngularJS, we have listed some below:

1. AngularJS supports MVC pattern
2. Can do two ways data binding using AngularJS
3. It has pre-defined form validations
4. It supports both client-server communication
5. It supports animations

<h2>7. What is data binding? Explain two-way data binding in AngularJs?</h2>
1. Data binding means automatic synchronous of data between model and view components.

2. AngularJS supports two-way data binding, it treats the model as a single source of truth and view is a projection of model. It means when we change model view gets reflect and vice-versa.

3. In traditional concept, HTML pages are decided by interacting with server-side program and as we using single page application, pages are decided without any server-side interaction. So required part of the page will be updated.

<h2>8. Distinguish between AngularJS expression & JavaScript expression?</h2>
AngularJS expression:

1. Expressions are evaluated against $scope.

2. Expression evaluation is forgiving to null and undefined.

3. In AngularJS, loops, conditions and exceptions are not required to write.

4. AngularJS supports filters to format data before displaying.

JavaScript Expression:

1. Expressions are evaluated against Window object.

2. Undefined properties generates Type Error or Reference Error

3. In AngularJS, loops, conditions and exceptions are required to write.

4. No such a feature.

<h2>9. What is a model in AngularJs?</h2>

1. Model is JavaScript object and it binds view data into the model through the directives such as text field, text area and selects etc.

2. It provides validation behaviors by required, number, URL, email, min and max length etc.

<h2>10. Distinguish between factory, service & provider?</h2>

Factory:

When you’re using a Factory you create an object, add properties to it, then return that same object. When you pass this service into your controller, those properties on the object will now be available in that controller through your factory.

Service:

When you’re using Service, it’s instantiated with the ‘new’ keyword. Because of that, you’ll add properties to ‘this’ and the service will return ‘this’. When you pass the service into your controller, those properties on ‘this’ will now be available on that controller through your service.

Providers:

Providers are the only service you can pass into your .config() function. Use a provider when you want to provide module-wide configuration for your service object before making it available.

Read More from https://www.onlineinterviewquestions.com/angular-js-interview-questions/