How do I access features ($db, $request, $container) within the callback?

  • 14 February 2017
  • 0 replies
  • 13 views


You should assign “this” context to a variable, and use the variable within the callback function as shown in the below example:




 var that = this;


 this.$db.get("ticket:101")


.done(function(data)


 {


  jQuery(that.$container).find('#id').text('Success');


 })


 .fail(function(error_data)


 {


  console.log(error_data)



 });



This topic has been closed for comments