Skip to content

Instantly share code, notes, and snippets.

View markusmo's full-sized avatar

Markus Mohanty markusmo

  • Vienna
View GitHub Profile
@klement97
klement97 / error.handler.ts
Last active June 26, 2023 12:16
A central solution to error handling in Angular Reactive Forms
import {AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors} from '@angular/forms';
import {Injectable} from '@angular/core';
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
export declare interface ServerError {
[key: string]: [];
}
@mavame
mavame / GoogleMapsApi.js
Last active December 6, 2023 21:53
A simple class for loading the Google Maps Javascript API in browser async using ES6 and Promise
/**
* Use this class to ensure Google Maps API javascript is loaded before running any google map specific code.
*/
export class GoogleMapsApi {
/**
* Constructor set up config.
*/
constructor() {
// api key for google maps