Explain component decorators in Angular4.

Sharad Jaiswal
Sharad Jaiswal

Posted On: Feb 22, 2018

 

A decorator is the core concept when developing an angular framework with version 2 and above. It may become a core language feature for JavaScript soon. In angular 4, decorators are used extensively and are also used to compile a code. There are 4 different types of decorators:

  • Class decorators
  • Property decorators
  • Method decorators
  • Parameter decorators

A decorator is a function that is invoked with a prefixed “@” symbol and is immediately followed by a class, parameter, method, or property. A decorator returns the same thing which was given as an input but in an augmented form.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Angular 4 Interview Questions

    Write the CLI command to generate a component in Angular4.

    Components are just simple classes which are declared as components with the help of component decorators. It becomes e..

    Angular 4 Interview Questions

    Explain the component directory structure of angular4.

    Here are the elements which are present in the component directory structure anf modules:-module.ts- in this, the angu..

    Angular 4 Interview Questions

    Explain ngFor directive with an example.

    The ngFor directive instantiates a template for every element of the given iterator. The different local variables of th..