使用ng-mask手机 [英] using ng-mask for phone

查看:405
本文介绍了使用ng-mask手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然怀疑使用ng-mask,我浏览了大部分网页,但它仍然保持不变。许多人告诉他使用angularjs的输入标签,这样做后我无法掩盖输入。或者我犯了错误,请有人纠正我,并给出使用ng-mask的清晰度。

I still have doubt in using ng-mask, I went through most of the web pages for it to work but it still remains the same. And many people told to use it with input tag of angularjs, after doing so Im not able to mask the input.Or am I making mistake please somebody correct me and give the clarity of using the ng-mask.

    <input type="tel" name="phoneno" maxlength=13  ng-model="phone.number" ng-mask="(999)999-9999"/>
    </div>          
<button class="button2" ng-click="home()">Back</button> &nbsp &nbsp &nbsp
<button class="button3" ng-click="addphone()">Add</button>


推荐答案

从网上下载ngMask.min.js

Download the ngMask.min.js from net

在app.js之前调用ngMask.min.js并包含app.js模块

Call the ngMask.min.js before app.js and Include app.js module

var yourApp= angular.module("yourApp", [
'ngMask'
]);

HTML:

<input type="tel" name="phoneno" maxlength=13 ng-model="phone.number" mask="(999)999-9999" />

这篇关于使用ng-mask手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆