Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

preventing +,-,e from input ts

<input(keyup)="_keyUp($event)">
Comment

preventing +,-,e from input ts

_keyUp(event: any) {
    const pattern = /[0-9+- ]/;
    let inputChar = String.fromCharCode(event.key);

    if (!pattern.test(inputChar)) {
      // invalid character, prevent input
      event.preventDefault();
    }
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: angular cancel http request 
Typescript :: how to check if a value exists in unorderedmaps 
Typescript :: filter posts by meta value wordpress 
Typescript :: ts async function type 
Typescript :: typescript array 
Typescript :: mat card api 
Typescript :: where to create assets folder in flutter 
Typescript :: typescript compare types 
Typescript :: Error: "prettier/@typescript-eslint" has been merged into "prettier" in eslint-config-prettier 8.0.0 
Typescript :: angular loadchildren lazy loading 
Typescript :: ts date get minutes 
Typescript :: stackoverflow ngbdate angular 
Typescript :: typescript interface to http params 
Typescript :: Interface with custom property name types 
Typescript :: stacks and its operaaton code 
Typescript :: typescript vue html css types 
Typescript :: ERROR Error: mat-form-field must contain a MatFormFieldControl. 
Typescript :: typescript class inheritance 
Typescript :: ts pipe function 
Typescript :: angular type of string 
Typescript :: angular minus date 
Typescript :: insertSheet() at the beginning of active sheets google script 
Typescript :: package minted missing pygments output 
Typescript :: function permutations() kalibrr 
Typescript :: This program prompts the user for two numbers, calls a function to determine the smaller number and prints the smaller number that is returned from the function 
Typescript :: muliple time series plots in pandas 
Typescript :: how-to-pass-data-between-middleware 
Typescript :: Summation with limits in MATLAB 
Typescript :: serenity.is custom list endpoint 
Typescript :: whats updog 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =