AngularJS
input内容消除后,由于ng-blur了,于是虽已不需要了,但仍有红框提示,而$scope.comment_form由于重名而为undefined.
解决方案:
前台:
div(ng-repeat="a in b")
form(name="comment_form")
input(ng-model="content" required)
button(ng-click="comment(comment_form)")
在controller中:
<pre name="code" class="javascript">$scope.comment=function(form){
$scope.content='';
form.$setPrinstine;
}