Angular 2 basic terminologies

Transpiler :

A source-to-source compiler, transcompiler or transpiler is a type of compiler that takes the source code of a program written in one programming language as its input and produces the equivalent source code in another programming language.
 
Decorator :

Decorators are a proposed standard for ECMAScript 2016 by Yehuda Katz, to annotate and modify classes and properties at design time. This sounds pretty much like what annotations do right? Well… sort of. Let’s take a look at what a decorator looks like:
// A simple decorator
@decoratorExpression
class MyClass { }
Wait. This looks exactly like an AtScript annotation! That’s right. But it isn’t. From a consumer perspective, a decorator indeed looks like the thing that we know as “AtScript Annotation”. There is a significant difference though. We are in charge of what our decorator does to our code. Taking the code above, a corresponding decorator implementation for @decoratorExpression could look like this:
function decoratorExpression(target) {
   // Add a property on target
   target.annotated = true;
}
Right. A decorator is just a function that gives you access to the target that needs to be decorated. Get the idea? Instead of having a transpiler that decides where your annotations go, we are in charge of defining what a specific decoration/annotation does.
This, of course, also enables us to implement a decorator that adds metadata to our code the same way AtScript annotations do (I keep referring to “AtScript annotations” because what they do, is really an AtScript specific thing). Or in other words: with decorators, we can build annotations.
===================================================

Some basic files and terminologies which are used in angular 2 application :
 
package.json lists packages the QuickStart app depends on and defines some useful scripts.

tsconfig.json is the TypeScript compiler configuration file.

typings.json identifies TypeScript definition files.  

systemjs.config.js, the SystemJS configuration file. 

One or more import statements to reference the things we need.

@Component Decorator that tells Angular what template to use and how to create the component.

A component class that controls the appearance and behavior of a view through its template.

main.ts  identifying the root component to Angular

Comments

Popular posts from this blog

Installing Wowza Streaming Engine on ubuntu

Highcharts with grouped categories

Completely Uninstall and Install Rubymine on ubuntu