Skip to content

Instantly share code, notes, and snippets.

View hollygood's full-sized avatar

Kathy H. hollygood

View GitHub Profile
@hollygood
hollygood / dynamic-fields.ts
Last active November 27, 2018 18:17
Angular 6 Generate Reactive Form Fields dynamically
//========================================= dynamic-fields.service.ts
import { Injectable } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
/**
* @description Dynamic fields service is used to generate reactive form group fields with Validators
*/
@Injectable({
providedIn: 'root'
@hollygood
hollygood / angular6-unsubscribe.md
Last active May 17, 2019 14:31
Different ways to unsubscribe Angular 6 Observables

Use 'unsubscribe':

export class ExampleComponent implements OnInit, OnDestroy {
  exampleSubOne: Subscription;
  exampleSubTwo: Subscription;

  constructor(private exampleService: ExampleService) {}

  ngOnInit() {