SlideShare une entreprise Scribd logo
1  sur  9
ANGULAR.JS INTERVIEW QUESTIONS
1) What is Angular.js?
AngularJS is a javascript framework used for creating singleweb page
applications. Itallows you to useHTML as your template language and enables
you to extend HTML’s syntaxto express your application’s components clearly
2) Explain what are the key features of Angular.js ?
The key features of angular.js are
 Scope
 Controller
 Model
 View
 Services
 Data Binding
 Directives
 Filters
 Testable
3) Explain what is scope in Angular.js ?
Scope refers to the application model, it acts like glue between application
controller and the view. Scopes are arranged in hierarchicalstructureand
impersonate the DOM( Document ObjectModel) structureof the application. It
can watch expressions and propagate events.
4) Explain what is services inAngular.js ?
In angular.js services arethe singleton objects or functions that are used for
carrying out specific tasks. Itholds some business logic and these function can be
called as controllers, directive, filters and so on.
5) Explain what is Angular Expression? Explain what is key difference between
angular expressions andJavaScript expressions?
Like JavaScript, Angular expressions arecode snippets that are usually placed in
binding such as {{ expression }}
The key difference between the JavaScriptexpressions and Angular expressions
 Context :In Angular, the expressions areevaluated against a scopeobject,
while the Javascriptexpressions areevaluated againstthe global window
 Forgiving: In Angular expression evaluation is forgiving to null and undefined,
while in Javascriptundefined properties generates TypeError or
ReferenceError
 No Control Flow Statements: Loops, conditionals or exceptions cannot be
used in an angular expression
 Filters: To formatdata before displaying it you can usefilters
6) Withoptions on page load how you can initialize aselect 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 ( ) ”>
7) Explain what are directives ? Mention some of the most commonly used
directivesinAngular.js application ?
A directive is something that introduces new syntax, they are like markers on
DOMelement which attaches a special behavior to it. In any Angular.js
application, directives are the most important components.
Some of the commonly used directives are ng-model, ng-App, ng-bind, ng-repeat
, ng-show etc.
8) Mention what are the advantages of using Angular.js ?
Angular.js has severaladvantages in web development.
 Angular.js supports MVS pattern
 Can do two ways data binding using Angular.js
 Ithas per-defined formvalidations
 Itsupports both client server communication
 Itsupports animations
9) Explain 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 bookmarkableURL in Angular.js is called a route
A value in Angular JS is a simple object. Itcan 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
10) Explain 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. Thereare two ways for data binding
1. Data mining in classical template systems
2. Data binding in angular templates
11) What makes angular.js better ?
 Registering Callbacks: Thereis no need to register callbacks . This makes your
code simple and easy to debug.
 Control HTML DOM programmatically: All the application that are created
using Angular never have to manipulate the DOMalthough it can be done if it
is required
 Transfer data to and from the UI: 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 dueto flow of marshalling data
 No initilization code:With angular.js you can bootstrap your app easily using
services, which auto-injected into your application in Guice like dependency
injection style
12) Explain what is string interpolation inangular.js ?
In angular.js thecompiler during the compilation process matches text and
attributes using interpolate serviceto see if they contains embedded
expressions. As partof normaldigest cycle these expressions areupdated and
registered as watches.
13) Mention the steps for the compilation process of HTML happens?
Compilation of HTML process occurs in following ways
 Using the standard browser API,firsttheHTML is parsed into DOM
 By using the call to the $compile () method, compilation of the DOMis
performed. The method traverses the DOMand matches the directives.
 Link the template with scope by calling the linking function returned fromthe
previous step
14) Explain what is directive andMention what are the different types of
Directive?
During compilation process when specific HTML constructs are encountered a
behaviour or function is triggered, this function is referred as directive. Itis
executed when the compiler encounters it in the DOM.
Different types of directives are
 Element directives
 Attribute directives
 CSS class directives
 Comment directives
15) Explain what is linking function and type of linking function?
Link combines the directives with a scope and produce a live view. For registering
DOMlisteners 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. Itis not considered as the safe way for DOMtransformation.
 Postlinking function: Postlinking function is executed after the child elements
are linked. Itis safeto do DOMtransformation by post-linking function
16) Explain what is injector?
An injector is a service locator. It is used to retrieve object instances as defined by
provider, instantiate types, invokemethods and load modules. There is a single
injector per Angular application, it helps to look up an object instance by its name.
17) Explain what is the difference betweenlink andcompile in angular.js?
 Compile function: Itis used for template DOMManipulation and collect all of
the directives.
 Link function: Itis used for registering DOMlisteners as well as instance DOM
manipulation. Itis executed once the template has been cloned.
18) Explain what is factory method in angular.js?
For creating the directive, factory method is used. Itis invoked only once, when
compiler matches the directive for the first time. By using $injector.invokethe
factory method is invoked.
19) Mention what are the styling formthat ngModel adds toCSS classes ?
ngModel adds these CSS classes to allow styling of formas well as control
 ng- valid
 ng- invalid
 ng-pristine
 ng-dirty
20) Mention what are the characteristics of “Scope”?
 To observer model mutations scopes provideAPIs ($watch)
 To propagate any model changes through the systeminto the view from
outside of the Angular realm
 A scopeinherits properties from its parentscope, while providing access to
shared model properties, scopes can be nested to isolate application
components
 Scope provides context againstwhich expressions areevaluated
21) Explain what is DI (Dependency Injection ) and how an object or function
can get a hold of its dependencies?
DI or Dependency Injection is a softwaredesign 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.
These are the ways thatobject 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 whereit is required
22) Mention what are the advantages of using Angular.js framework ?
Advantages of using Angular.js as framework are
 Supports two way data-binding
 Supports MVCpattern
 Supportstatic template and angular template
 Can add customdirective
 Supports RESTfull services
 Supports form validations
 Supportboth client and server communication
 Supportdependency injection
 Applying Animations
 Event Handlers
23) Explain the concept of scope hierarchy? How many scope can an
application have?
Each angular application consistof one rootscope but may have severalchild
scopes. As child controllers and somedirectives create new child scopes,
application can have multiple scopes. When new scopes are formed or created
they are added as a children of their parentscope. Similar to DOM, they also
creates a hierarchical structure.
24) Explain what is the difference between angular.js andbackbone.js?
Angular.js combines the functionalities of mostof the 3rd party libraries, it
supports individualfunctionalities required to develop HTML5 Apps. While
Backbone.js do their jobs individually.
25) Who created Angular JS ?
Intially it was developed by Misko Hevery and Adam Abrons. Currently it is being
developed by Google.
26) What is ng-cloak ?
ngCloak directive stop such type flicking issuein AngularJs. ngCloak work when
application bootstrapping . Itwill add ngCloak class on run-time till application
bootstrapped and ngCloak removethis class when application bootstrapped
successfully. Means ngCloak directiveadd ngCloak class on selected element and
remove ngCloak class when page loaded .
27) What is $rootScope ?
$rootScopeis a parentscope of all $scopeand can be shared to all $scope.One
application can have only one $rootScope. $scopeis a JavaScriptobject
associated to controller but $rootScopeis not.
28) What is use of ng-if ?
ng-if directive removeDOMelement if expression return false. And if expression
return true then it recreates a DOMtree again.
29) What is use of ng-show ?
ng-show useto show and hide elements fromDOMbut withoutmanipulation in
DOM. The main difference between ng-if and ng-show is ng-show add "class='ng-
hide'" attribute into element if expression return false and remove "class="ng-
hide" attribute fromelement when expression return true .
More AngularJs Articles
WHAT IS $ROOTSCOPE IN ANGULARJS
UNDERSTANDING NG-IF,NG-SWITCH,NG-SHOW AND NG-REPEAT
DIRECTIVES
WHAT IS NG-CLOAK DIRECTIVE IN ANGULARJS?
YPESCRIPT + ANGULAR 2 - ANGULARJS 2 WILL BE DEVELOPED WITH
TYPESCRIPT
DIFFERENT WAY TO WORK WITH NGCLASS
WHAT IS SCOPE AND SCOPE INHERITANCE
INJECTING SERVICE TO DIRECTIVES IN ANGULARJS
HOW TO SHOW SPARKLINES IN ANGULARJS
HOW TO SET TITLE DYNAMICALLY IN ANGULARJS
HOW TO CALL REST API IN ANGULARJS
HOW ROUTE WORK ON ANUGLARJS

Contenu connexe

Tendances

OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSJonathan Meiss
 
Modules in AngularJs
Modules in AngularJsModules in AngularJs
Modules in AngularJsK Arunkumar
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Max Klymyshyn
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJSYashobanta Bai
 
Angular js best practice
Angular js best practiceAngular js best practice
Angular js best practiceMatteo Scandolo
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginnersMunir Hoque
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) PresentationRaghubir Singh
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)Gary Arora
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0Nagaraju Sangam
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationEdureka!
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slidessamhelman
 

Tendances (20)

AngularJS
AngularJSAngularJS
AngularJS
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
 
Modules in AngularJs
Modules in AngularJsModules in AngularJs
Modules in AngularJs
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJS
 
Angular js best practice
Angular js best practiceAngular js best practice
Angular js best practice
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Angular Js
Angular JsAngular Js
Angular Js
 
Angular js
Angular jsAngular js
Angular js
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
 
Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page Application
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
 
Get satrted angular js
Get satrted angular jsGet satrted angular js
Get satrted angular js
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
 

En vedette

29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview QuestionsArc & Codementor
 
Angularjs interview questions and answers
Angularjs interview questions and answersAngularjs interview questions and answers
Angularjs interview questions and answersprasaddammalapati
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf serviceBinu Bhasuran
 
Wcf architecture overview
Wcf architecture overviewWcf architecture overview
Wcf architecture overviewArbind Tiwari
 
Scope in AngularJs
Scope in AngularJsScope in AngularJs
Scope in AngularJsThien To
 
2 Day - WPF Training by Adil Mughal
2 Day - WPF Training by Adil Mughal2 Day - WPF Training by Adil Mughal
2 Day - WPF Training by Adil MughalAdil Mughal
 
WPF For Beginners - Learn in 3 days
WPF For Beginners  - Learn in 3 daysWPF For Beginners  - Learn in 3 days
WPF For Beginners - Learn in 3 daysUdaya Kumar
 
Advanced WCF Workshop
Advanced WCF WorkshopAdvanced WCF Workshop
Advanced WCF WorkshopIdo Flatow
 
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra ChauhanASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra ChauhanShailendra Chauhan
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2FITC
 

En vedette (15)

29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 
Angularjs interview questions and answers
Angularjs interview questions and answersAngularjs interview questions and answers
Angularjs interview questions and answers
 
An Overview Of Wpf
An Overview Of WpfAn Overview Of Wpf
An Overview Of Wpf
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf service
 
Wcf architecture overview
Wcf architecture overviewWcf architecture overview
Wcf architecture overview
 
Scope in AngularJs
Scope in AngularJsScope in AngularJs
Scope in AngularJs
 
WCF 4.0
WCF 4.0WCF 4.0
WCF 4.0
 
2 Day - WPF Training by Adil Mughal
2 Day - WPF Training by Adil Mughal2 Day - WPF Training by Adil Mughal
2 Day - WPF Training by Adil Mughal
 
Threads c sharp
Threads c sharpThreads c sharp
Threads c sharp
 
WPF For Beginners - Learn in 3 days
WPF For Beginners  - Learn in 3 daysWPF For Beginners  - Learn in 3 days
WPF For Beginners - Learn in 3 days
 
Advanced WCF Workshop
Advanced WCF WorkshopAdvanced WCF Workshop
Advanced WCF Workshop
 
Wcf development
Wcf developmentWcf development
Wcf development
 
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra ChauhanASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 

Similaire à Angular.js interview questions

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to AngularjsGaurav Agrawal
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionOleksii Prohonnyi
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questionsGoa App
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development GuideNitin Giri
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQAvijit Shaw
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxsarah david
 
Modern webtechnologies
Modern webtechnologiesModern webtechnologies
Modern webtechnologiesBesjan Xhika
 
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptangularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptCuneiform Consulting Pvt Ltd.
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfsarah david
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxsarah david
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJSNitin Pandit
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfsarah david
 

Similaire à Angular.js interview questions (20)

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
 
Angular js
Angular jsAngular js
Angular js
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
 
Modern webtechnologies
Modern webtechnologiesModern webtechnologies
Modern webtechnologies
 
Angular introduction basic
Angular introduction basicAngular introduction basic
Angular introduction basic
 
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptangularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJS
 
Angular js
Angular jsAngular js
Angular js
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
 
Angular js introduction
Angular js introductionAngular js introduction
Angular js introduction
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
 

Plus de codeandyou forums

How to validate server certificate
How to validate server certificateHow to validate server certificate
How to validate server certificatecodeandyou forums
 
How to call $scope function from console
How to call $scope function from consoleHow to call $scope function from console
How to call $scope function from consolecodeandyou forums
 
Understand components in Angular 2
Understand components in Angular 2Understand components in Angular 2
Understand components in Angular 2codeandyou forums
 
Understand routing in angular 2
Understand routing in angular 2Understand routing in angular 2
Understand routing in angular 2codeandyou forums
 
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?codeandyou forums
 
How to install ssl certificate from .pem
How to install ssl certificate from .pemHow to install ssl certificate from .pem
How to install ssl certificate from .pemcodeandyou forums
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular jscodeandyou forums
 
How routing works in angular js
How routing works in angular jsHow routing works in angular js
How routing works in angular jscodeandyou forums
 
How to use proxy server in .net application
How to use proxy server in .net applicationHow to use proxy server in .net application
How to use proxy server in .net applicationcodeandyou forums
 
How to catch query string in angular js
How to catch query string in angular jsHow to catch query string in angular js
How to catch query string in angular jscodeandyou forums
 
How to set up a proxy server on windows
How to set up a proxy server on windows How to set up a proxy server on windows
How to set up a proxy server on windows codeandyou forums
 
What is $root scope in angularjs
What is $root scope in angularjsWhat is $root scope in angularjs
What is $root scope in angularjscodeandyou forums
 
How to save log4net into database
How to save log4net into databaseHow to save log4net into database
How to save log4net into databasecodeandyou forums
 

Plus de codeandyou forums (16)

How to validate server certificate
How to validate server certificateHow to validate server certificate
How to validate server certificate
 
How to call $scope function from console
How to call $scope function from consoleHow to call $scope function from console
How to call $scope function from console
 
Understand components in Angular 2
Understand components in Angular 2Understand components in Angular 2
Understand components in Angular 2
 
Understand routing in angular 2
Understand routing in angular 2Understand routing in angular 2
Understand routing in angular 2
 
How to setup ionic 2
How to setup ionic 2How to setup ionic 2
How to setup ionic 2
 
MongoDB 3.2.0 Released
MongoDB 3.2.0 ReleasedMongoDB 3.2.0 Released
MongoDB 3.2.0 Released
 
Welcome to ionic 2
Welcome to ionic 2Welcome to ionic 2
Welcome to ionic 2
 
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
 
How to install ssl certificate from .pem
How to install ssl certificate from .pemHow to install ssl certificate from .pem
How to install ssl certificate from .pem
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
 
How routing works in angular js
How routing works in angular jsHow routing works in angular js
How routing works in angular js
 
How to use proxy server in .net application
How to use proxy server in .net applicationHow to use proxy server in .net application
How to use proxy server in .net application
 
How to catch query string in angular js
How to catch query string in angular jsHow to catch query string in angular js
How to catch query string in angular js
 
How to set up a proxy server on windows
How to set up a proxy server on windows How to set up a proxy server on windows
How to set up a proxy server on windows
 
What is $root scope in angularjs
What is $root scope in angularjsWhat is $root scope in angularjs
What is $root scope in angularjs
 
How to save log4net into database
How to save log4net into databaseHow to save log4net into database
How to save log4net into database
 

Dernier

The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 

Dernier (20)

The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 

Angular.js interview questions

  • 1. ANGULAR.JS INTERVIEW QUESTIONS 1) What is Angular.js? AngularJS is a javascript framework used for creating singleweb page applications. Itallows you to useHTML as your template language and enables you to extend HTML’s syntaxto express your application’s components clearly 2) Explain what are the key features of Angular.js ? The key features of angular.js are  Scope  Controller  Model  View  Services  Data Binding  Directives  Filters  Testable 3) Explain what is scope in Angular.js ?
  • 2. Scope refers to the application model, it acts like glue between application controller and the view. Scopes are arranged in hierarchicalstructureand impersonate the DOM( Document ObjectModel) structureof the application. It can watch expressions and propagate events. 4) Explain what is services inAngular.js ? In angular.js services arethe singleton objects or functions that are used for carrying out specific tasks. Itholds some business logic and these function can be called as controllers, directive, filters and so on. 5) Explain what is Angular Expression? Explain what is key difference between angular expressions andJavaScript expressions? Like JavaScript, Angular expressions arecode snippets that are usually placed in binding such as {{ expression }} The key difference between the JavaScriptexpressions and Angular expressions  Context :In Angular, the expressions areevaluated against a scopeobject, while the Javascriptexpressions areevaluated againstthe global window  Forgiving: In Angular expression evaluation is forgiving to null and undefined, while in Javascriptundefined properties generates TypeError or ReferenceError  No Control Flow Statements: Loops, conditionals or exceptions cannot be used in an angular expression  Filters: To formatdata before displaying it you can usefilters 6) Withoptions on page load how you can initialize aselect 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
  • 3.  On = “! ! accounts” ng-init = “ loadData ( ) ”> 7) Explain what are directives ? Mention some of the most commonly used directivesinAngular.js application ? A directive is something that introduces new syntax, they are like markers on DOMelement which attaches a special behavior to it. In any Angular.js application, directives are the most important components. Some of the commonly used directives are ng-model, ng-App, ng-bind, ng-repeat , ng-show etc. 8) Mention what are the advantages of using Angular.js ? Angular.js has severaladvantages in web development.  Angular.js supports MVS pattern  Can do two ways data binding using Angular.js  Ithas per-defined formvalidations  Itsupports both client server communication  Itsupports animations 9) Explain 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 bookmarkableURL in Angular.js is called a route A value in Angular JS is a simple object. Itcan 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
  • 4. 10) Explain 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. Thereare two ways for data binding 1. Data mining in classical template systems 2. Data binding in angular templates 11) What makes angular.js better ?  Registering Callbacks: Thereis no need to register callbacks . This makes your code simple and easy to debug.  Control HTML DOM programmatically: All the application that are created using Angular never have to manipulate the DOMalthough it can be done if it is required  Transfer data to and from the UI: 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 dueto flow of marshalling data  No initilization code:With angular.js you can bootstrap your app easily using services, which auto-injected into your application in Guice like dependency injection style 12) Explain what is string interpolation inangular.js ? In angular.js thecompiler during the compilation process matches text and attributes using interpolate serviceto see if they contains embedded expressions. As partof normaldigest cycle these expressions areupdated and registered as watches. 13) Mention the steps for the compilation process of HTML happens?
  • 5. Compilation of HTML process occurs in following ways  Using the standard browser API,firsttheHTML is parsed into DOM  By using the call to the $compile () method, compilation of the DOMis performed. The method traverses the DOMand matches the directives.  Link the template with scope by calling the linking function returned fromthe previous step 14) Explain what is directive andMention what are the different types of Directive? During compilation process when specific HTML constructs are encountered a behaviour or function is triggered, this function is referred as directive. Itis executed when the compiler encounters it in the DOM. Different types of directives are  Element directives  Attribute directives  CSS class directives  Comment directives 15) Explain what is linking function and type of linking function? Link combines the directives with a scope and produce a live view. For registering DOMlisteners 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. Itis not considered as the safe way for DOMtransformation.  Postlinking function: Postlinking function is executed after the child elements are linked. Itis safeto do DOMtransformation by post-linking function 16) Explain what is injector?
  • 6. An injector is a service locator. It is used to retrieve object instances as defined by provider, instantiate types, invokemethods and load modules. There is a single injector per Angular application, it helps to look up an object instance by its name. 17) Explain what is the difference betweenlink andcompile in angular.js?  Compile function: Itis used for template DOMManipulation and collect all of the directives.  Link function: Itis used for registering DOMlisteners as well as instance DOM manipulation. Itis executed once the template has been cloned. 18) Explain what is factory method in angular.js? For creating the directive, factory method is used. Itis invoked only once, when compiler matches the directive for the first time. By using $injector.invokethe factory method is invoked. 19) Mention what are the styling formthat ngModel adds toCSS classes ? ngModel adds these CSS classes to allow styling of formas well as control  ng- valid  ng- invalid  ng-pristine  ng-dirty 20) Mention what are the characteristics of “Scope”?  To observer model mutations scopes provideAPIs ($watch)  To propagate any model changes through the systeminto the view from outside of the Angular realm
  • 7.  A scopeinherits properties from its parentscope, while providing access to shared model properties, scopes can be nested to isolate application components  Scope provides context againstwhich expressions areevaluated 21) Explain what is DI (Dependency Injection ) and how an object or function can get a hold of its dependencies? DI or Dependency Injection is a softwaredesign 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. These are the ways thatobject 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 whereit is required 22) Mention what are the advantages of using Angular.js framework ? Advantages of using Angular.js as framework are  Supports two way data-binding  Supports MVCpattern  Supportstatic template and angular template  Can add customdirective  Supports RESTfull services  Supports form validations  Supportboth client and server communication  Supportdependency injection  Applying Animations
  • 8.  Event Handlers 23) Explain the concept of scope hierarchy? How many scope can an application have? Each angular application consistof one rootscope but may have severalchild scopes. As child controllers and somedirectives create new child scopes, application can have multiple scopes. When new scopes are formed or created they are added as a children of their parentscope. Similar to DOM, they also creates a hierarchical structure. 24) Explain what is the difference between angular.js andbackbone.js? Angular.js combines the functionalities of mostof the 3rd party libraries, it supports individualfunctionalities required to develop HTML5 Apps. While Backbone.js do their jobs individually. 25) Who created Angular JS ? Intially it was developed by Misko Hevery and Adam Abrons. Currently it is being developed by Google. 26) What is ng-cloak ? ngCloak directive stop such type flicking issuein AngularJs. ngCloak work when application bootstrapping . Itwill add ngCloak class on run-time till application bootstrapped and ngCloak removethis class when application bootstrapped successfully. Means ngCloak directiveadd ngCloak class on selected element and remove ngCloak class when page loaded . 27) What is $rootScope ? $rootScopeis a parentscope of all $scopeand can be shared to all $scope.One application can have only one $rootScope. $scopeis a JavaScriptobject
  • 9. associated to controller but $rootScopeis not. 28) What is use of ng-if ? ng-if directive removeDOMelement if expression return false. And if expression return true then it recreates a DOMtree again. 29) What is use of ng-show ? ng-show useto show and hide elements fromDOMbut withoutmanipulation in DOM. The main difference between ng-if and ng-show is ng-show add "class='ng- hide'" attribute into element if expression return false and remove "class="ng- hide" attribute fromelement when expression return true . More AngularJs Articles WHAT IS $ROOTSCOPE IN ANGULARJS UNDERSTANDING NG-IF,NG-SWITCH,NG-SHOW AND NG-REPEAT DIRECTIVES WHAT IS NG-CLOAK DIRECTIVE IN ANGULARJS? YPESCRIPT + ANGULAR 2 - ANGULARJS 2 WILL BE DEVELOPED WITH TYPESCRIPT DIFFERENT WAY TO WORK WITH NGCLASS WHAT IS SCOPE AND SCOPE INHERITANCE INJECTING SERVICE TO DIRECTIVES IN ANGULARJS HOW TO SHOW SPARKLINES IN ANGULARJS HOW TO SET TITLE DYNAMICALLY IN ANGULARJS HOW TO CALL REST API IN ANGULARJS HOW ROUTE WORK ON ANUGLARJS