textlength angular code example
Example 1: length in typescript
var uname = "Hello world"
console.log("Length :"+uname.length) // returns the total number of characters
// including whitespace
Example 2: angular maxlength directive input type number
//maxlength="10"
<input type="number" onKeyPress="if(this.value.length==10) return false;" />