作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 View ,要求用户在文本框中输入他们的生日。
我正在使用UI-Utils中的mask指令。
我的 View 中包含以下输入元素:
<input ui-mask="99/99/9999" placeholder="MM/DD/YYYY" type="text" name="uBirthdate" ng-model="user.birthdate" required/>
myApp.controller('HomeCtrl', function ($scope, myService){
$scope.user = registerService.getCurrentUser();
$scope.submit = function () {
//do something with $scope.user.birthdate
};
}
});
11/20/1980
在$ scope中作为属性变为
11201980
最佳答案
升级到最新的angular-ui并使用以下语法
ui-mask="99/99/9999" model-view-value="true"
关于angularjs - 如何使用ui-mask从 Angular 输入中获取模型中的掩盖日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20999141/
我有一个很奇怪的问题,网页中的某些数字被随机标记为“*”。asp.net 4 webform 和 IIS Server 7 出现问题。我不知道为什么会这样。 例如:我们在文本框中的文字:45-3791
我是一名优秀的程序员,十分优秀!