Skip to content

Instantly share code, notes, and snippets.

View AlexandreMT's full-sized avatar
💭
Probably thinking about how to automate something

Alexandre Moraes Matos AlexandreMT

💭
Probably thinking about how to automate something
  • Sambatech
  • Palmas-TO
View GitHub Profile
@AlexandreMT
AlexandreMT / SubscriptionManager.ts
Last active September 30, 2019 19:17 — forked from julianpoemp/SubscriptionManager.ts
Easy and secure way to manage subscriptions in Angular 8 (and less)
/*
Version 1.1.0
For new versions of this class go to https://gist.github.com/julianpoemp/0c4dc13541b863f6503026333eb6b2b6
License: MIT
*/
import {Subscription} from 'rxjs';
export class SubscriptionManager {
private subscriptions: {
id: number,
import {Directive, ElementRef, Input, OnInit} from '@angular/core';
import { FormControl } from '@angular/forms';
type ErrorTypes = {
[key: string]: () => void;
};
@Directive({
selector: '[FormErrorsMessage]'
})