Friday, 29 December 2017

AngularJS 2


What is AngularJS 2? 
Ans : 1. Angular 2 is a JavaScript framework for developing web applications.
2. It is open source client side JavaScript framework.
3. Angular2 accomplishes a lot by embracing HTML,JavaScript and CSS.
4. It is well suited for developing mobile applications.
5. Angular 2:simple,faster,modular and instrumented.
6. Google and Microsoft join hands to develop Angular 2 on typescript.
7. The Angular 2 is using “Traceur” compiler.

Why to use AngularJS 2?
Ans : 1. It's  Ahead of Time compilation (AOT) improves rendering speed.
2. In Angular 2 users can update large data sets with less memory overhead.
3. It speeds up the initial load through server side rendering.
4. Lazy loading.
5. Better syntax and application structure.

Features of AngularJS 2
1. It is written entirely in Typescript and meets the ECMAScript  6 specification.
2. Dependency Injection: more opportunities for component/object-based work.
3. It Use of Typescript: the code written in Typescript less is prone to run time errors.
4. Generics: Typescript has generics which can be used add in front end.
5. Forms and Validations: within Angular 2 the form builder an control group are defined.
6. Component Based: Angular 2 is entirely component based.
7. controllers and $scope are no longer used.They have been replaced by components and directives.
8. Directives: with the @Directive annotation ,a directive can be declared.

What is ECMA script?
Ans : 1. It is a subset of JavaScript.
2. Languages such as Action Script,JavaScript,Jscript all use ECMAScript as its core.
3. AngularJS 2 supports ES 6 and higher versions.

4. Brendan Eich created Mocha which became Live Script,and later JavaScript 
      and later renamed to ECMA-262 aka ECMAScript.

Modules in AngularJS 2
1. Module is a unified group of code which is integrated with the other modules 
     to run the Angular apps.
2. A module exports some classes,function and values from its code.

What are pipes in AngualrJS 2?
Ans :  pipes in AngularJS 2 are a way to transform and format data from your templates.
         you get pipes for dates,currency,percentage and character cases.

Component in AngularJS 2
 1. It is a piece of code that can be used throughout an application as
 it knows how to render itself and configure dependency injection.
 2. It is a controller class with a template which mainly deals with application logic.

What is @Inputs in AngularJS 2?
Ans : 1. @Input allows you to pass data into your controller and 
templates through html and defining custom properties.
This allows you to easily reuse components and have them 
display different values for each instance of the render.

What is @Outputs in AngularJS 2?
Ans : 1. @Outputs is used to binds a property of a component to send the data 
from child component to parent component 
2. Components push out events using a combination of an @Output and an event emitter.
3. This allows a clean separation between reusable components and application logic.
4. It decorates output properties and its  binds a property of the type of angular  Event Emitter.

Directives in AngularJS 2
1. Directive is a class which contains metadata attached to the class by the @Directive decorator.
2. It change the DOM layout by adding  and renoving DOM
3. Directives change the appearance or behavior of an element,component,or other directive
4. There are three types of directives: 
A. Components directives
B. Structural directives
C. Attribute directives.


No comments:

Post a Comment