title: call function in ajax success callback
body: <p>Is it possible to call a function in success callback of ajax request?</p>
  
  <p>For example I have something like that : </p>
  
  <pre><code>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);
          })
      } 
  }
  </code></pre>
  
  <p>I want to call a function of my service (named  : changeValue() )  if my ajax request is a success.</p>
  
  <p>But I have this error message : <code>core.js:12632 ERROR TypeError: Cannot read property 'changeValue' of undefined</code></p>
  
  <p>Do you know if it's possible to resolve that ? </p>