title: Callback function in aurelia js
body: <p>Am new to aurelia js. Here, i need to do callback in aurelia js .
  Here is the code i tried,
  <strong>file.js</strong></p>
  
  <pre><code>this.commonFunctions.get_alrdyShrdUser(this.alrdyshardAry,function(err,result){
          if(!err){
              console.log("err,result",err,result);
              this.sharedAlrdy =  result;
          }else{
  
          }
      });
  </code></pre>
  
  <p><strong>commonFunctions</strong></p>
  
  <pre><code>get_alrdyShrdUser(docids,callback){
       this.httpValueConverter.call_http('sharing/users/list','POST',docids,'test')
          .then(data =&gt; {
          if(data.meta &amp;&amp; data.meta.statusCode == 200) {
          return callback(null,data.sharedUsers)
          }
      });
  }
  </code></pre>
  
  <p>Here all works fine, callback function also returned value, but i can't assign value to a aurelia varibale(<strong>this.sharedAlrdy</strong>).It throws error, <strong>Cannot set property 'sharedAlrdy' of undefined</strong>. Is that any other way to achieve?</p>