Skip to content

Instantly share code, notes, and snippets.

View barefacedbear's full-sized avatar
👋
Hello World !

Avishek Datta Ray barefacedbear

👋
Hello World !
View GitHub Profile
@barefacedbear
barefacedbear / validate-number.directive.ts
Last active January 30, 2022 03:47
Validate number only (decimal & non-decimal)
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
import { NgControl } from '@angular/forms';
@Directive({
selector: '[validateNumber]'
})
export class ValidateNumberDirective {
@Input('validateNumber') decimals = '';
/**