javascript - Can't submit form when add scope to directive AngularJS -


when remove scope everyting works fine...

here directive:

function addcomment(commentfactory) {     //creating button comment , call link function     var addcomment = {         link: link,         restrict: "e",         scope: {             valid: '='         },         template: '<input type="submit" ng-disabled="valid" class="btn btn-default pull-right" value="send" />'     }; .... 

here html:

<form name="maincomment" ng-submit='addcomment(param)' class="dd animated slideindown" novalidate>         <div class="form-group">             <text-angular name="maintxt" required ta-max-text="600" ta-min-text="15" ng-model="form.comment"></text-angular>              <span style="color:red" ng-show="maincomment.maintxt.$dirty && maincomment.maintxt.$invalid">                 <span ng-show="maincomment.maintxt.$error.required">thread content required.</span>             </span>             <p style="color:red" ng-show="maincomment.maintxt.$error.tamaxtext">text should @ last 15 characters.</p>             <p style="color:red" ng-show="maincomment.maintxt.$error.tamintext">text should not more 15 characters.</p>         </div>             <!--directive submit button , client content append-->             <addcomment valid="maincomment.maintxt.$invalid"></addcomment>      </form> 


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -