Typescript Tips and tricks for JS Developers (Part2)

Introduction 🚩:

#Tip1: Custom decorator 🔧 🔨

import { Component } from '@angular/core';import { StorageService } from './services/storage.service';@Component({selector: 'app-root',templateUrl: './app.component.html',styleUrls: ['./app.component.scss'],})export class AppComponent {title = 'customDecoratorwith';constructor(private storageService: StorageService) {}ngOnInit() {console.log(StorageService.getItem('test'));}}

#Tip2: More deep with Generics (constraint)🔧 🔨:

<T extends functArgs>

References 📓 📕:

Conclusion ✍️:

<script>alert('try your best')</script>