Angularjs interview questions and answers for freshers

 

Explain what is the bootstrapping in AngularJS?

The bootstrapping in AgularJS is nothing but just executing or starting your Angular application. It supports automatic bootstrapping as well as manual way.

Explain what are the features of Scope?

  • First of all to observer model mutations scopes allows APIs ($watch).
  • Second is to propagate any model changes through the system into the show from outside of the Angular realm.
  • The third step is scope inherits properties from its parent scope, or providing access to shared model properties, scopes can be nested to isolate application components.

And the last point the scope provides context against which expressions are calculated.

 

Mention is AngularJS compatible with all modern browsers?

Yes, AngularJS team runs an extensive test suite against the following browsers:

  • Safari
  • Chrome
  • Firefox
  • Opera 15
  • IE9

And some mobile browsers such as:

  • Android
  • Chrome Mobile
  • iOS Safari

Do you know what AngularJS performance is like?

First of we know the startup time heavily upon your network connection like, state of the cache and browser used and available hardware, whenever typically we measure bootstrap time in tens or hundreds of milliseconds. The runtime execution only depends on the number and complexity of bindings on the page as well as the accuracy of your backend. So just for clarification we typically made snappy applications with hundreds or thousands of active bindings.

Mention is it same as jQuery?

Anglers are different from jQuery. The jQuery is great library for manipulating the DOM, it provides better user experience with animations and more effectiveness. So, you can easily create a website using jQuery, but it is not a web application. The jQuery is just a library to play around with HTML, but AngularJS is a framework to build a dynamic web application and it supports two data binding, MVC provide testability, templates and so on. AngularJS like a toolbox and jQuery is just a tool.

READ  AngularJS Views and Directives

Give a more accurate example of data binding in AngularJS?

<div ng-app="" ng-init="quantity=10;cost=5">
<b>Total Cost: {{ quantity * cost }}</b>
</div>

Give an example of AngularJS Strings?

<div ng-app=””ng-init=”Str1= ‘Meraj’; Str2=’Ansari””>
Full String is: <b>{{ Str1 + “ “ + Str2 }}<b>
</div>

Do you know that, the basic need to start with AngularJS?

First time to start with AngularJS, we need to make reference of angular.js. The latest version of AngularJS can be downloading your system from AngularJS.com, and you can either download the needed js file or then host them locally or you can also use google CDN for helping it.

Mention what is looping and give an example?

In AngularSJ looping is used to display the data in loop same as for each in PHP.

 

<div data-ng-app="" data-ng-init="names=['Meraj','Ansari','Faizabad','India']">
<b>Loop Example:</b>
  <br />
<ul>
<li data-ng-repeat="x in names">
      {{ x }}
    </li>
</ul>
</div>

Define what is the basic concept of scope hierarchy?

Every Angular app consists of one root scope, but may have several child scopes. As a child controller and same directives make a new child scopes, apps can have multiple scopes. If when new scopes are created they are attached as children of their parent scope. Same as to DOM, they also create a hierarchical structure.

Can we make our self directive in AngularJS?

Absolutely AngularJS provide us to create our own custom directive.

Mention what is the string interpolation?

In AngularJS the compiler during the compilation process matches text and different elements using interpolate service to look if they contains embedded expressions. So, as a part of the normal digests cycle these expressions are updated and registered as watches.

READ  AngularJS Introduction

Mention why to choose AngularJS JavaScript Framework for front-end wed development?

Anglers are quickly becoming the dominant JavaScript framework for professional and web development. So, with the growth of HTML5 and the most increasing performance in popular browsers, the various JavaScript frameworks have been made to help develop rich client applications. All these libraries have given expert and developed a large tool kit to make enterprise complexity into the client side application, and the server side frameworks are becoming a thing of the past and being replaced by applications created in Knockout, Ember, AngularJS, and Backbone.