0
我在angularjs中输入类型url时出错。如果输入为空或无效,我将禁用该按钮,然后我写下面的代码。嗯,这是对首次Ø如果我写一个不正确的URL正常,但如果它是空propForm.imgUrl $无效,propForm.imgUrl。$ error.url返回我假,这使按钮AngularJS输入网址无效/有效/错误
<div class="col-sm-10">
<input type="url" name="imgUrl" ng-model="$parent.urlImage" class="form-control">
</div>
<div class="pull-right col-sm-2">
<a href="" class="btn btn-default btn-primary" ng-disabled="propForm.imgUrl.$invalid || propForm.imgUrl.$pristine || propForm.imgUrl.$error.url" ng-click="addImage()">Add</a>
</div>
的点击
诀窍在哪里?a