Loading…

What is decorator in angular 2?

Decorators allow developers to configure classes as elements by putting metadata on them.

The most common decorators are @Component one for components and @Injectable one for classes.

Decorators are new in TypeScript, and were not available in AngularJS. Angular2 onwards offers four types of decorators and each plays a unique role - Class, Property, Method, and Parameter.

Suggest An Answer

No suggestions avaliable!

Latest post from Angular 2 Interview Questions

Ask Question