Top 30 AngularJS Interview Questions and Answers

by Monika Dadool 28-Jan-19

0 551


1) What are the different versions of Angular?

a) AngularJS

b) Angular 2

c) Angular 4

d) Angular 5

e) Angular 6 beta version


2) In which Year AngularJS was developed?

2010


3) How many Efforts are required for AngularJS Developer, if he wants to work in an Angular 2 framework? List some difference between them?

AngularJS is Different from Angular 2, Developer of AngularJS needs more efforts and ground level study in order to switch framework because AngularJS is made up of purely javascript whereas Angular 2 is made up of Typescript. AngularJS is not designed on perspective to mobile support this is the reason why it is less mobile supportive.

According to Architecture, the Angular 2 is based on the service/controller whereas AngularJS is dependent on MVC. Angular 2 is faster and mobile supportive as a comparison to AngularJS


4) If we want to bind the value of HTML such as buttons, dropdown list, test box from a database. How we can bind it?

Through Angular JS


5) What is Angular JS?

AngularJS is a kind of Javascript framework mainly used in building Web Applications and more suitable for Single Page Applications. AngularJS is designed for binding javascript object with HTML elements. It executes on plain javascript along with Html pages.


6) Can you explain the Architecture of AngularJS?

AngularJS framework makes use of MVC Methodology made up of three components i.e. Template, scope, and controller, in other words, we can say MVC (Model, View, Controller).

MODEL: It is responsible for Application Data Management

VIEW: Whatever we Bind or do in the controller that will be exposed to users through the view, in other words, we can say through a view, Data can be presented to the users in a different format

CONTROLLER: It receives and responds to user inputs, undertakes DOM operations and modifications of the data model.

With the help of MVC based Architecture, AngularJS make the manageable structure and extend the HTML attributes with directives and bind the data to HTML with expressions.


7) What do you mean by the controller in AngularJS?

The controller is a function generally takes an empty scope object as parameters and acts it to the fields and functions that will be later exposed to the user through the view.

Download AngularJS PDF

8) Suppose we want to Share Data between controllers in AngularJS, how we can share it?

There are many methods that are used to share the data between controllers.

Some of the important ones are given below:

Services:

a) $rootscope

b) $broadcast

c) $emit method

d) Events

e) $state.go

f) $stateparam


9) List Difference between One way Binding and Two Way Binding in AngularJS?

The major difference between one way binding and two-way binding is UI impact

One-way Binding:

It is not synchronous process as it processes in one way. In this templates i.e. view part/UI are not updated automatically on Data model modification. For making it update every time, custom code is required.

Two-way Binding:

It is a synchronous process in which UI Updates automatically on Data model modification.


10) What is the role of AOT compilation in AngularJS?

Applications made up of AngularJS consist of HTML templates and some another component that cannot be directly understood by the Browser.

For that, a compilation process is required and in an Angular Application, Ahead-of-Time Compiler is used to compile application during building time.


11) An Angular JS is open-source software?

Yes


12) List some predefined Directives on AngularJS?

a) ng-app

b) ng-bind

c) ng-controller

d) ng-value

e) ng-disabled

f) ng-required

g) ng-click


13) What are the roles of Directive in AngularJS?

They are used to extend the functionality of the HTML by integrating Attributes with ng-prefix. They are the markers on the Data object Model and you can use it with any of the controls or HTML tags which will tell the compiler what specified behavior that DOM is expecting.

AngularJS comes with many inbuilt Directives. The developer can also manually create it as per their application requirement.


14) Who Developed AngularJS?

Adam Abrons and Misko Hevery had started working on GetAngular project in 2009. Due to some reason, Adam Abrons stopped working but Misko Hevery with his manager update the existing project and named it as AngularJS in 2010


15) Which Directive is used to initialize Angular Application?

ng-app


16) Suppose if we want to validate the email address or phone number in AngularJS. How we can do it?

Through Angular form Validation and ng-pattern Directive


17) Which module in AngularJS is helpful in Application to become Single Page Application?

ngRoute module


18) If you want to create Different URLs for Different Content in our Application. Which concept can be used in AngularJS?

AngularJS routes


19) Explain Routing in AngularJS?

Routing is the switching views Concept. This concept plays a major role in building single page Application with multiple views. AngularJS routing permits the developer to create different URLs for different content on their Application and also helpful on the logical division of the Application and its Binding through different controllers in order to make it more manageable.


20) For Data formatting, which feature are Applicable in AngularJS?

Filters are used in AngularJS. There are different filters found in AngularJS through which you can transform data on your application as per your requirement. They are used to display filtered data from the list of items depending upon specific criteria. Some of the filters are given below:

a) lowercase

b) date

c) filter

d) Json

e) limitTo

f) uppercase

g) orderBy


21) How you can integrate filters in the expression in AngularJS?

Filters are integrated into the expression through pipe character | followed by the specific filter.

Example:

<div ng-app="webapp" ng-controller="modifytext">

<p>The Application name is {{first name | uppercase}} </p>

</div>


22) Give some disadvantage of AngularJS?

a) Not Degradable

b) Not much secure

c) Lagging User Interface

d) Confusion of choosing better method as AngularJS permits different methods to do the same task.


23) Give some applications of AngularJS?

a) Weather Applications

b) User Reviews Applications

c) Mobile Commerce

d) Travel Applications.


24) What do you mean by SPAs Application?

Single Page Applications are the web Applications that load a single page of HTML and dynamically update it as per user interaction with the application and it never allows reloading of the page.


25) Why AngularJS Framework is most widely used for developing SPAs Application?

Because of the following reasons:

a) AngularJS is compatible with almost every browser.

b) It permits multiple page routing

c) Very less coding required

d) Simpler Data binding

e) Best UI support

f) AngularJS permits SPAs application easy to maintain.

g) Fast performance and more flexible.


26) What is the purpose of a "track by" in AngularJS?

The "track by" is used with ng-repeat to boost the rendering performance. Use of duplicate key in angular Js is not permitted, for avoiding this "track by" along with ng-repeat is used with angular expressions for the unique identification.

It also describes how the association between model and DOM tracked by AngularJS.


27) Which function is used to add run blocks on the module in AngularJS?

run()


28) how can we format a Date in AngularJS?

We can do this through Date filter

{{ today | date:'MM/dd/yyyy'}}


29) Suppose we want to want to disable right click event in AngularJS. Which function can be used?

We required to integrate the disable-right-click as the element's attribute and after that preventDefault() function to cancel the event.


30) list some events found in AngularJS?

a) ng-click

b) ng-dblclick

c) ng-mouseleave

d) ng-mouseenter

e) ng-change

f) ng-keydown

g) ng-keypress

h) ng-mousedown

i) ng-keyup


31) Is it possible to do animation in AngularJS?

Yes, we can do animation in AngularJS for that there firstly required to include AngularJS Animate library and then ngAnimate module integration.


32) Name some browsers that support AngularJS?

a) Mozilla firebox

b) Google Chrome

c) Internet Explorer 10,11

d) Android


Share:


Comments

    Waiting for your comments

Leave a Reply