久久久久久久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成人免费无遮挡大片 | 国产伦精品一区二区三区高清 | 三级视频在线观看 | 久久久www成人免费精品张筱雨 | 51ⅴ精品国产91久久久久久 | 成人福利 | 亚洲电影第1页 | 亚洲一区二区三区高清 | 视频二区 | 欧美日韩成人在线观看 | 亚洲v日韩v综合v精品v | 在线黄色影院 | 国产精品一区二区免费看 | 综合网中文字幕 | 国产精品一区二区三 | 精品1区2区 | 国产激情一区二区三区 | 一区二区三区四区av | 成人区精品 | 99爱视频 | 国产成人精品一区二区三区网站观看 | 日韩电影一区 | 天天拍天天射 | 爱爱视频在线观看 | 亚洲色图综合 | 成人三级在线观看 | 日本精品久久久久 | 欧美久| 91精品国产一区二区三区 | www国产精品 | 日韩精品一区二区三区中文在线 | 日韩一区二区三区在线视频 | 国产91中文 | 一区二区久久 | 精品美女久久久 | 国产一区在线免费观看视频 | 日韩三级一区 | www.伊人.com| 日韩成人专区 | 日韩在线综合 |