Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

TypeDecorator

An interface implemented by all Angular type decorators, which allows them to be used as decorators as well as Angular syntax.

See more...

      
      interface TypeDecorator {
<T extends Type<any>>(type: T): T
(target: Object, propertyKey?: string | symbol, parameterIndex?: number): void
(target: unknown, context: unknown): void }

Description

      
      @ng.Component({...})
class MyClass {...}
    

Methods

Invoke as decorator.

      
      <T extends Type<any>>(type: T): T
    
Parameters
type T
Returns

T

      
      (target: Object, propertyKey?: string | symbol, parameterIndex?: number): void
    
Parameters
target Object
propertyKey string | symbol

Optional. Default is undefined.

parameterIndex number

Optional. Default is undefined.

Returns

void

      
      (target: unknown, context: unknown): void
    
Parameters
target unknown
context unknown
Returns

void