我需要(999) 999-9999
像这个例子http://angular-ui.github.io/ui-utils/那样做电话掩码,但是对于 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">
占位符被劫持或什么的。如何修复占位符?
然后当我输入一些数字时,一切都搞砸了,并在其中注入了一些占位符文本。怎么修?
或者,我不需要仅将 ui-utils 用于一件事。Ionic 是否有任何手机面罩替代品?
type=tel
对我不起作用,因为它只弹出数字键盘,没有别的。
我确实需要显示占位符“输入电话号码”。所以显示 (___) ___ ____ 是行不通的