AngularJS Interview Questions and Answers

AngularJS one kind of JavaScript framework. It is used to create web applications. Day by day its importance is increasing. Here is some common important questions and answers in AngularJS. Hope it will help you to build successful carrier.

What is AngularJS?
AngularJS is a open source JavaScript framework for creating single page web applications.  These types of applications need HTML, CSS and JavaScript only. AngularJS extends our existing HTML attributes with Directives and binds data to HTML with Expressions. AngularJS is written in JavaScript and is distributed as a JavaScript file.

What is the History of AngularJS
AngularJS was originally developed by Miško Hevery and Adam Abrons in 2009 at Brat Tech LLC. It is now officially backed by Google.

Who created AngularJS ?
Initially Misko Hevery and Adam Abrons created the AnjularJS. Currently it is being developed by Google.

Does AngularJS use the jQuery Library?
Yes, Angular can use jQuery.

Is it necessary to use jQuery in AnjularJS application?
No, we don’t need to use jQuery while we are using AngularJS in an application.

What are the key features of Angular.js ?
Angular.js key features are given bellow:

  • Scope
  • Controller
  • Model
  • View
  • Services
  • Data Binding
  • Directives
  • Filters
  • Testable

What are the advantages of using AngularJS?
AngularJS is new technology for web development. Its advantages are given bellow:

  • It supports two ways data-binding
  • It supports MVC pattern
  • It supports static template and angular template
  • It can add custom directive
  • It supports REST full services
  • It supports form validations
  • It supports both client and server communication
  • It Support dependency injection
  • It supports per-defined form validations
  • It support animations
  • Event Handlers

What is Scope in AngularJS
Scope is an object that refers to the application model. It acts like glue between the controller and view. They are arranged in hierarchical structure and impersonate the DOM (Document Object Model) structure.  There is one root scope (ng-app) for the application with hierarchical children scopes. Scope creates an execution context for expressions. It marshals the model to the view and forwards events to the controller.

Controller
For construction the model the controller is responsible and it connects the model to the view. The scope present between the controller and the view. Controller should be simple and contain the business logic. Controller can be nested.

Model
In AngularJS model is a JavaScript object.

View
In AngularJS view is the HTML. It is based on DOM object. It does not contain any functional behavior.  We can use multiple view for single controller.

What is Services in AngularJS?
In AngularJS the Services are singletons objects or functions that perform common tasks for web applications. We use it when we need to exchange common functionality between Controllers. Built-in AngularJS Services start with a $. We can build service in several ways like: Service API, Factory API, or the $provide API.

What is Data Binding in AngularJS?
In AngularJS the data binding between view and model is two way. Automatic synchronization of data between model and view occurred without any extra works. There are two ways for data binding:
Data mining in classical template systems
Data binding in angular templates

What is Directives?
In AngularJS directives are used to specify custom and reusable HTML tags that moderate the behavior of certain elements. Some directives are given bellow:

  • ng-app
  • ng-bind
  • ng-model
  • ng-model-options
  • ng-class
  • ng-controller
  • ng-repeat
  • ng-show & ng-hide
  • ng-switch
  • ng-view
  • ng-if
  • ng-app

Can we create our own directives?
Yes, we can.

What is Filters?
In AngularJS filter is used to format data before display.

What is the difference between AngularJS and backbone.js?
AngularJS combines the functionalities of most of the 3rd party libraries.Backbone.js do their jobs individually.

Comments

  1. By Suber

    Reply

  2. By Tomo M

    Reply

Leave a Reply

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