vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

xeditable success mathod not working with Angular2 #477

Open aashishab opened 8 years ago

aashishab commented 8 years ago

Hi,

I want to make my form Submit button enable once you add the comment in the form field. But it is not working.. Here is my code snippet:

template:

< div class="col-sm-1 m-t-xs text-left"> < a (click)="showComment()" id="Comments" data-type="textarea" data-pk="1" data-url="" data-title="Enter comments">< i (click)="showComment()" class="text-primary text-left" title="Click to enter comments">< /i>< /a> < /div> < button type="submit" id="saveData" [ngClass]="editForm.valid && editForm.dirty ? 'btn-primary' : 'btn-default'" [disabled]="!(editForm.valid && editForm.dirty)">Save changes< /button>

Component class:

$('#Comments').editable({ 'rows ': 4, 'inputclass': 'word-wrap newComments', success: function(response, newValue) { if (newValue) { if(this.editForm.valid) { this.editForm.dirty = true; } }

        }
    });
ckosloski commented 8 years ago

What is the error you are getting and can you provide a plunker or jsfiddle showing your issue?

aashishab commented 8 years ago

It is not giving any error. It is not calling its success method or not invoking it.

ckosloski commented 8 years ago

See if there is anything in this thread that will help you.