Рет қаралды 1,080
#decorators #angular #customDecorators
This video talks about developing 7 widely used custom Angular decorators along with basic introduction of a decorator.
0:12 What is a Decorator?
0:32 Categories of Decorator
4:00 PageAnalytics Decorator
7:02 Constructor Function example
10:22 Decorator Factory
12:11 Injecting service in decorator
13:14 Unsubscribe Decorator
17:36 Debounce Decorator
21:05 PropertyDescriptor
22:30 Throttle Decorator
24:19 setTimeout Decorator
25:28 Timer decorator (calculate the time taken to execute a function)
27:00 ReadOnly property decorator
GIST of example code
- Angular Page Analytics Decorator GIST
gist.github.com/sanjeevsubedi...
- Angular Debounce Decorator GIST
gist.github.com/sanjeevsubedi...
- Angular Throttle Decorator GIST
gist.github.com/sanjeevsubedi...
- Angular Readonly Decorator GIST
gist.github.com/sanjeevsubedi...
- Angular setTimeout Decorator GIST
gist.github.com/sanjeevsubedi...
- Angular auto unsubscribe from subscription GIST
gist.github.com/sanjeevsubedi...
- Angular timer GIST to calculate the time to execute a function
gist.github.com/sanjeevsubedi...
Helpful resources:
- www.typescriptlang.org/docs/h...
- github.com/tc39/proposal-deco...