AngularJS 1x Interview Questions and Answers (36) - Page 1

What are scopes in AngularJs ?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is true about ng-controller directive?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is true about ng-disabled directive?

NOTE: This is objective type question, Please click question title for correct answer.
Which components can be injected as a dependency in AngularJS?

NOTE: This is objective type question, Please click question title for correct answer.
What happens when page containing AngularJS based Application loads.

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is true about uppercase filter?

NOTE: This is objective type question, Please click question title for correct answer.
Explain directives in AngularJS.

Directives are markers on DOM elements (such as elements, attributes, css, and more). These can be used to create custom HTML tags that serve as new, custom widgets. AngularJS has built-in directives (ng-bind, ng-model, etc) to perform most of the task that developers have to do.
Explain ng-app directive.

ng-app directive defines and links an AngularJS application to HTML. It also indicate the start of the application.
What is a service?

Services are JavaScript functions and are responsible to do specific tasks only. Each service is responsible for a specific task for example, $http is used to make ajax call to get the server data. $route is used to define the routing information and so on. Inbuilt services are always prefixed with $ symbol
How to retrieve the scope of a DOM element in AngularJS?

To retrieve the scope of a DOM element in AngularJS, we can use following code snippet.
var scope = angular.element("elmentSelector").scope()

Which AngularJS directives creates its own scope?

NOTE: This is objective type question, Please click question title for correct answer.
What is AngularJS?

1. AngularJS is an open-source JavaScript framework developed by Google.
2. It helps you to create single-page applications or one-page web applications that only require HTML, CSS, and JavaScript on the client side.
3. It is based on MV-* pattern and allow you to build well structured, easily testable, and maintainable front-end applications.
4. AngularJS is not based on jQuery to perform its operations. In spite of using ASP.NET Web form, ASP.NET MVC, PHP, JSP, Ruby on Rails for web development, you can do your complete web development by using most powerful and adaptive JavaScript Framework AngularJS.
What is jqLite?

NOTE: This is objective type question, Please click question title for correct answer.
Why to use AngularJS?

1. It is based on MVC pattern which helps you to organize your web apps or web application properly.
2. It extends HTML by attaching directives to your HTML markup with new attributes or tags and expressions in order to define very powerful templates.
3. It also allows you to create your own directives, making reusable components that fill your needs and abstract your DOM manipulation logic.
4. It supports two-way data binding i.e. connects your HTML (views) to your JavaScript objects (models) seamlessly. In this way any change in model will update the view and vice versa without any DOM manipulation or event handling.
5. It encapsulates the behaviour of your application in controllers which are instantiated with the help of dependency injection.
6. It supports services that can be injected into your controllers to use some utility code to fulfil your need. For example, it provides $http service to communicate with REST service.
What are the advantages of AngularJS?

1. Data Binding - AngularJS provides a powerful data binding mechanism to bind data to HTML elements by using scope.
2. Customize & Extensible - AngularJS is customized and extensible as per you requirement. You can create your own custom components like directives, services etc.
3. Code Reusability - AngularJS allows you to write code which can be reused. For example custom directive which you can reuse.
4. Support – AngularJS is mature community to help you. It has widely support over the internet. Also, AngularJS is supported by Google which gives it an advantage.
5. Compatibility - AngularJS is based on JavaScript which makes it easier to integrate with any other JavaScript library and runnable on browsers like IE, Opera, FF, Safari, Chrome etc.
6. Testing - AngularJS is designed to be testable so that you can test your AngularJS app components as easy as possible. It has dependency injection at its core, which makes it easy to test.
How AngularJS is different from other JavaScript Framework?

AngularJS is different from other JavaScript framework in following ways:
1. AngularJS mark-up lives in the DOM.
2. AngularJS uses plain old JavaScript objects (POJO).
3. AngularJS is leverages with Dependency Injection.
What IDEs you can use for AngularJS development?

1. Visual Studio 2012, 2013, 2015 or higher
2. Eclipse
3. WebStorm
4. Sublime Text
5. TextMate
How to use jQuery with AngularJS?

By default AngularJS use jQLite which is the subset of jQuery. If you want to use jQuery then simply load the jQuery library before loading the AngularJS. By doing so, Angular will skip jQLite and will started to use jQuery library.
What is jQLite or jQuery lite?

jQLite is a subset of jQuery that is built directly into AngularJS. jQLite provides you all the useful features of jQuery. In fact it provides you limited features or functions of jQuery.
Is AngularJS a library, framework, plugin or a browser extension?

AngularJS is a first class JavaScript framework which allows you to build well structured, easily testable, and maintainable front-end applications. It is not a library since library provides you limited functionality or has dependencies to other libraries.
It is not a plugin or browser extension since it is based on JavaScript and compatible with both desktop and mobile browsers.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories