【问题标题】:ui-utils phone mask does not work with Ionic inputui-utils 电话掩码不适用于 Ionic 输入
【发布时间】:2015-09-18 02:42:37
【问题描述】:

我需要像这个例子http://angular-ui.github.io/ui-utils/ 那样做电话掩码(999) 999-9999,但用于Ionic 移动应用程序输入。

ui-utils 在裸 AngularJS 应用程序中运行良好:http://plnkr.co/edit/NozbdhtRjaxq1KFYrwLo?p=preview

  <body ng-controller="MainCtrl">
    <input type="text" ng-model="phonenumber" ui-mask="(999) 999-9999">
  </body>

但是,Ionic 也无法正常工作:http://codepen.io/hawkphil/pen/qdxOLW?editors=101

<input type="text" placeholder="First Name" ui-mask="(999) 999-9999" ng-model="attendee.firstname">

  1. 占位符被劫持了。如何修复占位符?

  2. 然后,当我输入一些数字时,一切都搞砸了,并在其中注入了一些占位符文本。如何解决?

  3. 另外,我不需要仅仅为了一件事而使用 ui-utils。 Ionic 是否有任何手机面罩替代品? type=tel 对我不起作用,因为它只会弹出数字键盘而不会弹出其他任何内容。

我确实需要显示占位符“输入电话号码”。所以显示 (___) ___ ____ 将不起作用

【问题讨论】:

    标签: javascript angularjs ionic-framework angular-ui angularjs-ui-utils


    【解决方案1】:

    试试&lt;input type="text" placeholder="First Name" ui-mask="(999) 999-9999" ng-model="attendee.firstname" ui-mask-placeholder&gt;。插件的“ui-mask-placeholder”理解这一点很重要。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-25
      • 1970-01-01
      • 2018-08-13
      • 1970-01-01
      • 2016-10-14
      • 2020-06-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多