Is it possible to call a function in success callback of ajax request?
For example I have something like that :
constructor(private http: HttpClient,private serviceComposition: CompositionService) { }
[...]
save() {
    var isValid = this.isValidCompo();
    if (true) {
        var toSend = JSON.stringify(this.setupComposition);
        $.ajax({
            url: "/api/setup/composition/addSetupComposition",
            type: 'POST',
            dataType: "json",
            data: 'setupComposition=' + toSend,
            success:function(response){
                //console.log("Success Save Composition");
            },
            error: function(XMLHttpRequest,textStatus,errorThrown){
                console.log("Error Save Compo");
            }
        }).done(function(data){
            this.serviceComposition.changeValue(isValid);
        })
    } 
}
I want to call a function of my service (named : changeValue() ) if my ajax request is a success.
But I have this error message : core.js:12632 ERROR TypeError: Cannot read property 'changeValue' of undefined
Do you know if it's possible to resolve that ?
 
     
    