1.

What is the difference between annotation and decorator in Angular 2?

Answer»
AnnotationDecorator
Used by Traceur compilerUsed by Typescript compiler
Annotation creates the attribute ‘ANNOTATIONS’ that stores arrays and PASS metadata to the constructor of the annotated class.It is a function that GETS the object that needs to be decorated (or constructed). They can change the attributes of the object as necessary.
Annotations are hard-codedNot hard-coded
EXAMPLE – import {COMPONENT} from 'angular2/angular2';Example - import {ComponentAnnotation as Component} from 'angular2/angular2';


Discussion

No Comment Found