久久久久久久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 正在被拾取(如果不滿足條件,按鈕將被禁用).現(xiàn)在我想將輸入限制為數(shù)字并在其前面加上 06(數(shù)字最少的荷蘭電話號碼).

                  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 被綁定.該模式需要靜態(tài)添加到 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模板網(wǎng)!

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

                  相關文檔推薦

                  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 用于動態(tài)元素 - 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 中的值發(fā)生變化時檢索本地存儲值)

                • <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>
                            主站蜘蛛池模板: 在线视频福利 | 日韩欧美国产一区二区三区 | 久久98| 国产这里只有精品 | 亚洲成人av在线播放 | 久久免费小视频 | 国产伦精品一区二区三区在线 | 免费视频久久久 | 日韩中文在线观看 | 中文字幕免费看 | 少妇av在线 | 亚洲精品一二三 | 免费黄色片视频 | 伊人av综合 | 激情五月综合色婷婷一区二区 | 羞羞网站在线观看 | 欧美黄色片在线观看 | 亚洲欧美一区二区三区四区 | 欧美一区二区三区在线视频 | 欧美日韩免费在线观看 | 精品在线免费视频 | www.4hu95.com四虎| 亚洲午夜18毛片在线看 | 春色导航 | 欧美国产日韩在线 | 永久免费看mv网站入口亚洲 | 毛片资源 | 国产亚洲视频在线观看 | 日韩三级久久 | 亚洲 欧美 综合 | 久久人体视频 | 久久性色 | 欧美理论片在线观看 | 黄色一级片网站 | 午夜视频免费在线观看 | 欧美成人一级 | 久草福利资源站 | 欧美成人精品一区二区三区 | 国产精品国产三级国产 | 免费看黄色av| 九色91popny蝌蚪 |