Search code examples
javascriptangularinputangular-materialmat-input

Searching a contact without country code in mat input (angular)


I am working on matinput in angular templates. I am using it for searching puposes inside a list. In list we have different customers with contact i.e. (country code)(phone-number) +92 3011111111. When I search for +92 301... It works fine. But when I replace +92 with 0 (as per number format in our region) It returns me with no contact. Is there any way to replace +92 or any other country code with 0. Thanks in advance. Lemme know if more clarification is needed. (vote question up if its clear and fine so i can ask more questions when needed)

Current angular version working with: 9


Solution

  • I resolved this by replacing +92 with 0 while searching as it will check for both +92 when + is in the search and Will search with 0 when there is no + character in search