Deepak Verma
How many types of Decorator are present in Angular?
By Deepak Verma in Angular on Mar 12 2018
  • Mahesh Verma
    Mar, 2018 13

    1. Class Decorator e.g. @Component and @NgModule. 2. Property Decorator e.g. @Input and @Output. 3. Method Decorator e.g. @HostListner 4. Parameter Decorator e.g. @Inject.

    • 10
  • Srinivas Pabballa
    Mar, 2018 16

    Decorators are functions, and there are four things (class, parameter, method and property) that can be decorated; consequently there are four different function signatures for decorators:class: declare type ClassDecorator = (target: TFunction) => TFunction | void; property: declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; method: declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; parameter: declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;

    • 3
  • Prashanth Kumar
    Mar, 2018 29

    Class decorators, e.g. @Component and @NgModule Property decorators for properties inside classes, e.g. @Input and @Output Method decorators for methods inside classes, e.g. @HostListener Parameter decorators for parameters inside class constructors, e.g. @Inject

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS