我需要像这个示例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">
占位符被劫持或其他什么。如何修复占位符?
然后当我输入一些数字时,它全部搞砸了并且注入了一些占位符文本。如何解决?
或者,我不需要仅仅为了一件事使用ui-utils。 Ionic有替代手机面膜吗? type=tel
对我不起作用,因为它只会弹出数字小键盘,而不是其他内容。
我确实需要显示占位符“输入电话号码”。所以显示(___)___ ____将不起作用
答案 0 :(得分:0)
试试<input type="text" placeholder="First Name" ui-mask="(999) 999-9999" ng-model="attendee.firstname" ui-mask-placeholder>
。重要的是“ui-mask-placeholder”&#39;对于插件了解这一点。