Q. What is AngularJS & what is its use in web development?
Answer
AngularJS is a structural client-side open-source JavaScript Framework developed by Google.
As we know AngularJS follows the MVW* pattern and it allows us to build well-structured testable & maintainable front-end applications.
Its uses
- AngularJS helps us to create single-page (one-page) applications with the help of HTML, CSS, and JavaScript on the client side.
- AngularJS allows us to create custom directives which are reusable components & abstract your DOM manipulation.
- It supports two-way data binding. With the help of a way data binding model will update the view without any DOM manipulation.
- It supports services & dependency injection which can easily be injected into our controller & provide some utility code as per our requirement.
Q. What are the features used in AngularJS & why?
Answer
AngularJS supports some features that have uses for creating web apps.
AngularJS Feature
- Module: It is like a container for different components.
- Directive: It is a combination of AngularJS template markups and supporting Javascript code.
- Template: It is a combination of HTML, directives, filters & attributes.
- Scope: It is a Java script object that refers to the application module.
- Expression: It is much like JavaScript expression. It uses {{Expression}} to show data in html.
- Data binding: Data binding is synchronized data between model & view.
- MVC Pattern: MVC pattern is also called model view controller.
- Validation: AngularJS provides you built-in validation directive to validate from the client side.
- Filters: It is used to format data before displaying users.
- Services: It is called reusable business logic.
- Routing: It helps you to divide your app into multiple views and bind different views to controllers.
- Dependency Injection: It is a software design pattern that deals with how components get hold of their dependencies.
- Injector: Container of dependency injection.
- Testing: The unit test doesn't need to load all the apps, just loading that specific module is enough to start unit testing.
Q. What is Module & why do we use it?
Answer
It is a container. It divides apps into small components whose reusable, functional components are integrated with other components.
- It is the place where we write AngularJS code for web apps.
- Each module is identified by a unique name and can be dependent on another module.
- It is the place where we define dependencies.
- AngularJS module is single on every web page.
Why do we use Module?
- Modules are used to separate logics say services, controllers, applications, etc., and keep the code clean.
- We define modules in separate JS files and name them as per the module. Js file.
Q. Explain controller inheritance with an example
Answer
Controller inheritance also works like scope inheritance works. Implementing in controller inheritance the child controller will inherit prototypically from its parent's scope, so when we need to reuse that functionality from the parent controller all you need to add is the required method to the parent controller.
Example
<script type="text/javascript">
Module.controller('ParentCtrl', function($scope) {
$scope.$broadcast('event', args);
$scope.$on('event-response', function(result) {});
});
Module.controller('ChildCtrl', function($scope) {
$scope.$on('event', function(args) {
var result;
$scope.$emit('event-response', result);
});
});
</script>
Q. Can you describe the config () & run () method & why we use it?
Answer
- Config: Config block using for block creating in AngularJS.it will executed as provider register. It can only inject provider & constant in configuration block.
- Run: It use to put event handler at root lavel. Run block executed after configuration block.it inject instance & constants.it is like as c,c++ main method.

Manoj KallaPosted Feb 12, 2016, 7:27 AM
very good..
Anupam SinghPosted Feb 12, 2016, 1:05 AM
Useful explanation, not only for interview.
Pankaj Kumar ChoudharyPosted Feb 11, 2016, 11:33 PM
Nice Efforts Shiva.....
Pradeep SahooPosted Feb 11, 2016, 7:48 PM
good information
Kuppurasu NagarajPosted Feb 11, 2016, 12:46 PM
nice
Gowtham KPosted Feb 11, 2016, 11:04 AM
Nice
Debasis SahaPosted Feb 11, 2016, 8:30 AM
Nice one..
Amit Kumar SinghPosted Feb 11, 2016, 8:20 AM
Good Article
Rupesh KahanePosted Feb 11, 2016, 8:08 AM
Very helpfull
Shashangka ShekharPosted Feb 11, 2016, 7:21 AM
Thanks
Anil Kumar MurmuPosted Feb 11, 2016, 4:47 AM
Thanks for sharing
Sibeesh VenuPosted Feb 11, 2016, 1:51 AM
Nice Share
Shiva ShuklaPosted Feb 11, 2016, 12:14 AM
thanks Santhakumar Munuswamy,Shubham Kumar,Humayun Kabir Mamun,Jaipal Reddy & sreenivasa k
Shubham KumarPosted Feb 10, 2016, 11:57 PM
nice
Jaipal ReddyPosted Feb 10, 2016, 11:24 PM
Thanks .
Humayun Kabir MamunPosted Feb 10, 2016, 10:56 PM
Nice...
Santhakumar MunuswamyPosted Feb 10, 2016, 2:17 PM
Thanks for your information
sreenivasa kPosted Feb 10, 2016, 10:48 AM
good