Jul 13

AngularJs Interview Question Part-I

1. AngularJs Key Features
Ans. -> Following are angularjs key features
a. Model
b. View
c. Controller
d. Scope
e. Data Binding
f. Filters
g. services
h. Directive

2. What is services in AngularJs
Ans. -> Services in AngularJs are singleton object or function that are used for carying specific task. Services Belong to some business logic and function, that is called directive, controller and filters.

3. What is angularJs Expressions. Explain diffrence between angularjs expression and javascript expression.
Ans. -> angularjs expressions are code snippet that are used for data binding like {{Expression}}
a. Context :- In angularjs, the expression are evaluated against a scope object, while javascript expression evaluated against the global windows.
b. Forgiving :- In angularjs expression evalution is forgiving to null ad undefined, while in javascript undefined properties generates typeerror or referenceerror.
c. No Control Flow Statements :- Loops, conditionals of exceptions cannot be used in and angular expression.
d. Filters :- to format data before displaying it you can use filters.

4. Advantages of AngularJs.
Ans. -> angularJs has several advantages in web development.

  • AngulaJS Support MVC pattern
  • Two way data binding possible using AngularJs
  • It has per-defined form validations
  • Supports REST full services
  • supports both client server communication
  • Support dependency injection
  • Support Animation
  • Event Handlers

5. Diffrence between link and compile function in angularJs
Ans.-> Compile function is used for template DOM manipulation and to collect all the directives. Link function is used for registering DOM Listners as well as instance DOM Manipulation and is executed once the template has been cloned.

6. what is injector in angularJs?
Ans. -> An injector is a service locator, used to retrieve object instance as defied by provider, instantiate types, invoke methods and load modules.

7. what is difference between AngularJs and Backbone.Js?
Ans.->AngularJS combines the functionalities of most third party libraries and supports individual functionalities required to develop HTML5 Apps while backbone.js does these jobs individually.

8. String interpolation in AngularJs?
Ans.-> In AngularJs the compiler matches text during the compilation process and attributes using interpolate service to see contains embedded expressions.

9. Steps for the compilation process of HTML.
Ans. -> using browser API, first HTML is parsed into DOM. by using the $compile method , compilation of DOM is performed. The method traverses the DOM and matches the directives. Link the template with scope by calling the linking funtion returned from the previous step.

10. What are Controllers in AngularJS?
Ans. -> Controllers are Javascript functions wich provide data and logic to HTML UI. As the name suggests, they control how data flows from the server to HTML UI.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>