Engineering, Design, Marketing, and More

Angular.js interview questions

The most popular questions

Use our complementary questions and answers to filter and hire the best. Questions crowdsourced by our clients, answers by Punch. We provide these complementary questions to help our clients more quickly create tests for potential hires at their organizations.

Get a question answered
Punch offers four divisions of services: design, engineering, staffing, and demand

Interview questions for your next interview

Question
Why should we use AngularJS?
Answer
AngularJS is a Javascript Framework that help maintaining client-side Javascript code in MVVM & MVC fashion. The framework provide models, services, factories, controllers and directives that help customising UI use cases.
Question
What is $scope in AngularJS?
Answer
$scope is a predefined object that is made available to each controller defined on module for binding DOM HTML elements with controller. $scope represents model in MVC architecture, as it can also directly contain data retrieved from backend for populating UI.

Find developers today

Hire a Punch engineer

Punch offers four divisions of services: design, engineering, staffing, and demand. Our four divisions form the core of our People Forward Approach.

Contact us
Find developers today
Question
What is interpolation in AngularJS?
Answer
{{}} is denoted as Interpolation markup in AngularJS. Any expression inside braces would be evaluated and result is replaced with innerHTML of binded DOM node.
Question
What is two-way binding in AngularJS?
Answer
Two way binding in AngularJS means that value of interpolated or binded variable objects can be changed from UI as well as from controller. The change in value takes place almost immediately at controller as well as template.
Question
What is one-way binding in AngularJS?
Answer
One way binding in AngularJS means that the value in UI can only be changed from controller. For one-way binding we use extra syntax as {{ ::foo }} to override default two-way binding.
Question
What is $watch in AngularJS?
Answer
$watch is a method provided by Angular on $scope object. Method is invoked with two parameters, binding object to watch in form of string and callback function which is invoked at end of Angular’s digest cycle.
Question
What are limitations of $watch in AngularJS?
Answer
$watch takes advantage of event driven behaviour in Javascript and checks every few milliseconds for changes that need update globally. $watch’ing too many objects would grow size of event loop, making whole application slow.
Question
What is directive in AngularJS?
Answer
Directive is a method defined on module object, which is used to create extended HTML attributes i-e. . Directive can have its own controller, $scope, template and other properties that help customizing functionality of directive.
Question
What is dependency injection in AngularJS?
Answer
Dependency injection is injecting Singleton objects in methods. AngularJS resolve dependencies before invoking function and thus when function is invoked it has access to injected objects.
Question
How do modules communicate in AngularJS?
Answer
Modules can communicate with each other using factories/services or by events such as $broadcast/$emit callbacks provided on $scope.

Find developers today

Hire a Punch engineer

Punch offers four divisions of services: design, engineering, staffing, and demand. Our four divisions form the core of our People Forward Approach.

Contact us
Find developers today
Question
How does $scope.$emit and $scope.$broadcast differ in AngularJS?
Answer
$scope.$broadcast check children $scope chain for callback bind via $scope.$on to be invoked with particular event name i.e. $scope.$broadcast(‘foo’) would look for $scope.$on(‘foo’, callback). While $scope.$emit check parent $scope chain for event listener.
Question
What is isolated scope in AngularJS?
Answer
Isolated scope for a directive ensures that $scope for directive is not inherited from parent and doesn’t share bindings.
Question
How inheritance work with isolated scope in AngularJS?
Answer
Parent directive can pass children directive objects and values it need for rendering. There are three different ways by which children directive can get values from parent i.e. ‘=’, ‘&’, ‘@’
Question
How promises are customised in AngularJS?
Answer
AngularJS provides a built in service $q that help creating promises.
Question
Why should we not use AngularJS?
Answer
Using or not using AngularJS depends on scope and functionality of your app. It might not fit in the case where we have long lists of data, images populating on single page. Pagination and other techniques might refactor issue, but binding huge data for longer interval of time can run browser into memory leak issues.

Ask a question

Ask a question, and one of our engineers will answer it.

We keep our questions nice and simple to be useful for everyone, and we may not answer or publish every question.

Your number is stored privately and never shared.
By submitting a question, you agree to our terms.
Request sent. Thank you!
Send another one