久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='f5oS3'><style id='f5oS3'><dir id='f5oS3'><q id='f5oS3'></q></dir></style></legend>
      <bdo id='f5oS3'></bdo><ul id='f5oS3'></ul>

      <small id='f5oS3'></small><noframes id='f5oS3'>

      <i id='f5oS3'><tr id='f5oS3'><dt id='f5oS3'><q id='f5oS3'><span id='f5oS3'><b id='f5oS3'><form id='f5oS3'><ins id='f5oS3'></ins><ul id='f5oS3'></ul><sub id='f5oS3'></sub></form><legend id='f5oS3'></legend><bdo id='f5oS3'><pre id='f5oS3'><center id='f5oS3'></center></pre></bdo></b><th id='f5oS3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='f5oS3'><tfoot id='f5oS3'></tfoot><dl id='f5oS3'><fieldset id='f5oS3'></fieldset></dl></div>
        <tfoot id='f5oS3'></tfoot>

        使用模式 Angular 2 進行輸入驗證

        Input validation with pattern Angular 2(使用模式 Angular 2 進行輸入驗證)

          <i id='3AiuE'><tr id='3AiuE'><dt id='3AiuE'><q id='3AiuE'><span id='3AiuE'><b id='3AiuE'><form id='3AiuE'><ins id='3AiuE'></ins><ul id='3AiuE'></ul><sub id='3AiuE'></sub></form><legend id='3AiuE'></legend><bdo id='3AiuE'><pre id='3AiuE'><center id='3AiuE'></center></pre></bdo></b><th id='3AiuE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3AiuE'><tfoot id='3AiuE'></tfoot><dl id='3AiuE'><fieldset id='3AiuE'></fieldset></dl></div>
            <tfoot id='3AiuE'></tfoot>

              • <small id='3AiuE'></small><noframes id='3AiuE'>

                  <bdo id='3AiuE'></bdo><ul id='3AiuE'></ul>

                    <tbody id='3AiuE'></tbody>
                  <legend id='3AiuE'><style id='3AiuE'><dir id='3AiuE'><q id='3AiuE'></q></dir></style></legend>

                • 本文介紹了使用模式 Angular 2 進行輸入驗證的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我目前正在用 ionic 2 (Angular 2) 編寫一個簡單的表單.我想知道如何在驗證中添加一個簡單的 正則表達式 模式:

                  I'm currently writing a simple form in ionic 2 (Angular 2). I was wondering how I'd add a simple regular expression pattern to the validation:

                  我基本上有這個:

                  <form>
                      <ion-input stacked-label>
                          <ion-label>{{label.msisdn}}</ion-label>
                          <input type="text"
                                 [(ngModel)]="msisdn"
                                 ngControl="msisdnForm"
                                 required
                                 maxlength="10"
                                 minlength="10"
                                 pattern="06([0-9]{8})"
                                 #msisdnForm="ngForm"
                          >
                      </ion-input>
                      <button [disabled]="!msisdnForm.valid" block (click)="requestActivationCode()">
                          {{label.requestActivationCode}}
                      </button>
                  </form>
                  

                  最大長度、最小長度和required 正在被拾取(如果不滿足條件,按鈕將被禁用).現在我想將輸入限制為數字并在其前面加上 06(數字最少的荷蘭電話號碼).

                  The maxlength, minlength & required are being picked up (the button is disabled if conditions not met). Now I want to limit the input to numeric and prefix it with 06 (Dutch phone number with minimum amount of numbers).

                  但是,該模式并未在驗證中被選中.我可以這樣做,還是需要代碼方法?

                  The pattern is however not picked up in the validation. Can I do it this way, or do I need a code approach?

                  推薦答案

                  將模式添加到變量中

                  var pattern=/06([0-9]{8})/;
                  

                  并將屬性綁定到它

                   <input type="text"
                                 [(ngModel)]="msisdn"
                                 ngControl="msisdnForm"
                                 required
                                 maxlength="10"
                                 minlength="10"
                                 [pattern]="pattern"
                                 #msisdnForm="ngForm"
                          >
                  

                  似乎這個 PR https://github.com/angular/angular/pull/6623/files 需要先登陸.

                  Seems this PR https://github.com/angular/angular/pull/6623/files needs to land first.

                  還有一個未解決的問題 https://github.com/angular/angular/issues/7595這可以防止 pattern 被綁定.該模式需要靜態添加到 DOM(無需綁定)才能工作.

                  There is still an open issue https://github.com/angular/angular/issues/7595 This prevents pattern being bound to. The pattern needs to be statically added to the DOM (without binding) to work.

                  這篇關于使用模式 Angular 2 進行輸入驗證的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
                  How to reload the ion-page after pop() in ionic2(如何在 ionic2 中的 pop() 之后重新加載離子頁面)
                  Retrieve localstorage value when value is change in Ionic 2(當 Ionic 2 中的值發生變化時檢索本地存儲值)

                • <i id='IqRPn'><tr id='IqRPn'><dt id='IqRPn'><q id='IqRPn'><span id='IqRPn'><b id='IqRPn'><form id='IqRPn'><ins id='IqRPn'></ins><ul id='IqRPn'></ul><sub id='IqRPn'></sub></form><legend id='IqRPn'></legend><bdo id='IqRPn'><pre id='IqRPn'><center id='IqRPn'></center></pre></bdo></b><th id='IqRPn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IqRPn'><tfoot id='IqRPn'></tfoot><dl id='IqRPn'><fieldset id='IqRPn'></fieldset></dl></div>

                      <bdo id='IqRPn'></bdo><ul id='IqRPn'></ul>
                    • <tfoot id='IqRPn'></tfoot>

                          • <small id='IqRPn'></small><noframes id='IqRPn'>

                            <legend id='IqRPn'><style id='IqRPn'><dir id='IqRPn'><q id='IqRPn'></q></dir></style></legend>
                              <tbody id='IqRPn'></tbody>
                            主站蜘蛛池模板: 国产欧美日韩一区二区三区 | www.日本国产 | 国产亚洲精品久久久久久豆腐 | 免费a级毛片在线播放 | 91麻豆精品国产91久久久久久 | 中文字幕第一页在线 | 久久久久久久久久久久91 | 午夜电影一区二区 | 亚洲国产自产 | 久久精品色视频 | 亚洲午夜电影 | 三级av在线| 国产精品久久久久久久久久免费看 | 欧美在线一区二区三区 | 国产jizz女人多喷水99 | 丝袜美腿一区二区三区动态图 | 日韩电影中文字幕 | 特黄毛片视频 | 亚洲最新在线视频 | 国产精品无码久久久久 | 日韩av一区二区在线观看 | 亚洲欧美在线视频 | 不卡一区二区在线观看 | 午夜影院在线视频 | 亚洲中国字幕 | 国产一区二区三区免费视频 | www国产精品 | 午夜无码国产理论在线 | 日韩成人在线观看 | 99福利视频 | 欧洲视频一区二区 | 精品免费国产 | 亚洲高清在线观看 | 狠狠躁夜夜躁人人爽天天高潮 | 日韩欧美国产精品 | 国产一区二区免费在线 | 爱草在线| 99热99| 激情久久网 | 久久99一区二区 | 成人午夜视频在线观看 |