Friday 27 January 2017

ANGULARJS INTERVIEW QUESTIONS - Set 4


31. Does Angular use the jQuery library?

 

YES, Angular can use jQuery if it’s present in your app when the application is being bootstrapped. If jQuery is not present in your script path, Angular falls back to its own implementation of the subset of jQuery that we call jQLite.

32. Why AngularJS?

 

AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.
MVC implementation is done right.
It extends HTML using directives, expression and data binding techniques to define a powerful HTML template.
Two way data-binding, form validations, routing supports, inbuilt services.
REST friendly.
Dependency injection support.
It helps you to structure and test your JavaScript code.

33. What are the key features/concepts of Angular.js?


When you start learning AngularJS, you will come across following terms and these are the features/concept of AngularJS.
Scope
Directives
Expression
Filters
Data Bindings
Model
View
Controller
Modules
Services
Dependency Injection

Here you can find more topics about the AngularJS Concepts.

34. Is AngularJS is compatible with all modern browsers?

 YES. AngularJS team run extensive test suite against the following browsers: Safari, Chrome, Firefox, Opera 15, IE9 and mobile browsers (Android, Chrome Mobile, iOS Safari).

35.What is the basic need to start with AngularJS?

 

To start with AngularJS, one need to make reference of angular.js. The latest version of AngularJS can be downloaded from AngularJS.com. You can either download the required js file and then host them locally or you can also use google CDN for referencing it. Here is the link for google CDN url for referencing AngularJS.

36. How does the AngularJS framework initialize itself?

 

The AngularJS has a self-executing anonymous function present in angular.js code, which does the initialization of AngularJS.
Here is how below it looks:
(function(window, document, undefined) {
<!--
here goes entire AngularJS code
including functions, services, providers etc related code goes here
-->
if (window.angular.bootstrap) {
    //AngularJS is already loaded, so we can return here...
    console.log('WARNING: Tried to load angular more than once.');
    return;
  }
 
  //try to bind to jquery now so that one can write angular.element().read()
  //but we will rebind on bootstrap again.
  bindJQuery();
 
  publishExternalAPI(angular);
 
  jqLite(document).ready(function() {
    angularInit(document, bootstrap);
  });
 
})(window, document);
Above function first check if Angular has already been setup. If it has, we return here to prevent Angular from trying to initialize itself a second time. And then it binds jQuery (if present) and publish external API. And finally angularInit() method does the trick for initialization of AngularJS.

37. What is the bootstrapping in AngularJS?


Bootstrapping in AngularJS is nothing but just initializing, or starting, your Angular app. AngularJS supports automatic bootstrapping as well as manual way as well.

 38. What are templates in AngularJS?

 

In Angular, templates are written with HTML that contains Angular-specific elements and attributes. Angular combines the template with information from the model and controller to render the dynamic view that a user sees in the browser. In other words, if your HTML page is having some Angular specific elements/attributes it becomes a template in AngularJS.

 

39. What are directives in AngularJS?

 

Directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS to attach a specified behavior to that DOM element or even transform the DOM element and its children. When AngularJS finds the directive at the time of rendering then it attaches the requested behavior to the DOM element. Angular comes with a set of these directives built-in, like ngBind, ngModel, and ngClass.

40. Can we create our own directives?

 


YES. AngularJS allows us to create our own custom directive.

To know more about the Angularjs Course details, Please visit Best Angularjs Training.

1 comment:

  1. Sain Bainuu,


    Hip Hip Hooray! I was always told that slightly slow in the head, a slow learner. Not anymore! It’s like you have my back. I can’t tell you how much I’ve learnt here and how easily! Thank you for blessing me with this effortlessly ingestible digestible content.

    I m new in angular js and i have create chatbot using angular 5 & dialogflow with the help of below link: https://angularfirebase.com/lessons/chatbot-in-angular-with-dialogflow-api-ai/I want auto scroll to bottom if the new message is overcome.
    I read multiple articles and watched many videos about how to use this tool - and was still confused! Your instructions were easy to understand and made the process simple.


    MuchasGracias,

    ReplyDelete