Angular JS Interview Question Set 4
Categories: Angular JS
Explain the auto bootstrap process in AngularJS
Angular initializes automatically DOMContentLoaded event or when you download angular.js script is to the browser.
After this, AngularJS find the ng-app directive that is the root of angular app compilation. When ng-app directive is found, AngularJS do the following steps:
1) load the module, which is associated with the directive,
2) Create application injector,
3) Compile the DOM from the ng-app root element. This process is known as auto bootstrapping.
What is immediately invoked function expressions?
IIFEs or Immediately Invoked Function Expressions is a function that executes as soon as it is created. It offers a simple way to isolate the variable declaration. IIFEs contains two major functions:
1) operator()
2) expression()
What is the digest cycle in AngularJS?
Digest cycle is important part of the data binding in AngularJS, which compares the old and new version of the scope model. Digest cycle triggered automatically or manually by using $apply() function.
What is the basic requirement to work with AngularJS?
You have to download the latest version of AngularJS from AngularJS.com to learn or work with AngularJS. You can either need JS file and host it locally, or you can also use google CDN (Content Delivery Network) for referencing it.
Can we create nested controllers in AngularJS?
Yes, we can create a nested controller in AngularJS.
Example of nested controller is as follows:
<div ng-controller="MainCtrl">
<p>{{msg}} {{name}}!</p>
<div ng-controller="SubCtrl1">
<p>Hi {{name}}!</p>
<div ng-controller="SubCtrl2">
<p>{{msg}} {{name}}! Your name is {{name}}.</p>
</div>
</div>
</div>
What is Authentication?
The authentication is a service that is used to login and logout of Angular application. The credentials of users pass to API on the server. Then post server-side validation these credentials, JSON Web Token is returned, which as detail about the current user.
Define AngularJS Material
AngularJS Material is an implementation of the Material Design Specification of Google. It offers a set of well-tested, reusable UI components for AngularJS programmer.
What are the important differences between Angular 7 and Angular 8
Angular 7 - Angular 8
Angular 7 is hard to use -Angular 8 is very easy to use
It provides supports for the lower version of Typescript 3.4 programming language - It does not provide support for the lower version of Typescript 3.4 programming language
Supports all versions of Node.js - Supports only Node.js 12 version.
What is ngzone?
The ngzone is a JavaScrip wrapper class which is denoted by Zone.js. It enables developers to explicitly run certain code outside Angular’s zone, which inhibits angular to run any change detection.
List out the difference between Angular Component and Directive
ComponentDirective
Angular component is a directive that enables you to utilize the web component functionality throughout the application. - Angular directive is a technique by which we attach behavior to the elements.
It helps you to divides your application into smaller components. - It helps you to design the reusable components.
It can define pipes -It cannot define pipes.
Define ECMAScript
ECMAScript (European Computer Manufacturer’s Association) is a standard for scripting languages. JavaScript uses ECMAScript as a core language. Developers can take help of it for writing client-side scripting on the world wide web and or server applications and services. ECMAScript has numerous features like functional, prototype, dynamic, and structured features.