Skip to content

Instantly share code, notes, and snippets.

@nakulvijay56
nakulvijay56 / regex-remove.ts
Last active Mar 2, 2020
Angular : This is a custom directive to remove matching regex pattern from ngModel inputs
View regex-remove.ts
import { Directive, HostListener, Input, OnChanges, Optional } from '@angular/core';
import { NgModel } from '@angular/forms';
/**
* @description
*
* This is a custom directive to remove matching regex pattern from ngModel inputs
*
* eg:
* (will remove character matching the default regular expression present in the directive)
You can’t perform that action at this time.