Call us: +91-9962812914  |  +91-9962812876 |   

contactmahitech@gmail.com

AngularJS Interview Questions

AngularJS is a framework to build large scale and high performance web application while keeping them as easy to maintain. AngularJS is a powerful Javascript based development framework to create RICH Internet Application(RIA). AngularJS provides developers options to write client side application in a clean MVC. AngularJS is open source,completely free and used by thousands of developers around the world.

1.What are the controllers in AngularJS?

Controllers are Javascript functions that are bound to a particular scope. They are the prime actors in AngularJS framework and carry functions to operate on data and decide which view is to be updated to show the updated model based data.

2.Explain directives in AngularJS.

Directives are makers on DOM elements(such as elements,attributes,css).These can be used to create custom HTML tags that serve as new, custom widgets. AngularJS has built-in directives to perform most of the task that developers have to do.

3.What is deep linking in AngularJS?

Deep linking allows you to encode the state of application in the URL so that it can be bookmarked. The application can then be restored from the URL to the same state.

4.What are the key features of AngularJS?

Scope
Controller
Model

5.Explain what is linking functions and type of 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.

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

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

6.What is injector?

An injector is a service locator.It is used to retrieve object instances as defined by provider,instantiate types,invoke methods and load modules. There is a single injector per Angular application, it helps to look up an object instance by its name.

7.Explain the role of $routeprovider in AngularJS.

The $routeprovider is used to configure roots within an AngularJS application.It can be used to link an url with a corresponding HTML page or template, and a controller.

8.What is scope in AngularJS?

Scopes are objects that refer to the model. They act as glue between controller and view.

9.Explain templates in AngularJS.

Templates are the rendered view with information from the controller and model.These can be single file or multiple views in one page using :partials”.

10.What are the differences between service and factory methods?

Factory method is used to define a factory which can later be used to create services as and when required whereas service method is used to create a service whose purpose is to do some defined task.

Leave a comment

Your email address will not be published. Required fields are marked *