كيف يمكنك إنشاء حقل نصي من خلاله يمكن للمستخدم إدخال أرقام فقط

 يمكنكم بكل ببساطة فعل ذلك عن طريق الأوامر التالية:

<input formControlName="mobileNo" matInput [(ngModel)]="user.mobileNo" #mobile_no type="text"
onKeyPress="if(this.value.length==10) return false; return event.charCode >= 48 && event.charCode <= 57"
placeholder="مثلاً: 0508532127" required>

تعليقات

المشاركات الشائعة من هذه المدونة

ngx-extended-pdf-viewer

how to getting access token for https://fcm.googleapis.com/v1/projects/al-ayahya-co/messages:send for angular and backend nestjs

طريقة تفعيل زر Inline Keyboard في Telegram Bot