我有一个select用于上传图像的html 选项.
<div class="row smallMargin">
<div class="col-sm-6">
Attach Image
</div>
<div class="col-sm-6">
<input type="file" ng-model="image" accept="image/*">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
如何限制用户上传大于2MB的图像?
我有一个像这样的JSON数组:
[
{
"user": "345",
"createdOn": "2015-09-01 13:17:22"
},
{
"user": "432",
"createdOn": "2015-09-01 13:27:56"
}
Run Code Online (Sandbox Code Playgroud)
]
在<div>标签中,我这样做:
<div> class="row" ng-repeat="item in array"
{{item.createdOn}}
</div>
Run Code Online (Sandbox Code Playgroud)
输出为:2015-09-01 13:50:59,但我不希望显示时间部分,即所需的输出仅为2015-09-01。我尝试使用filter但未成功。请给我一些知识。
<input type="text" placeholder="Title" onkeyup="CheckLength(this.value);"/>
Run Code Online (Sandbox Code Playgroud)
并在JavaScript文件中,
function CheckLength(currentValue)
{
if(currentValue.length > 6)
alert("Only 6 letters are allowed, please follow the rule!");
}
Run Code Online (Sandbox Code Playgroud)
我想要的是在6个字符之后,无论用户输入的内容都不应该在文本框中显示,并且应该显示警告.你可以帮助我吗?