title: Vuejs access function from nested fuction
body: <p>I am trying to access a function A from  a function in a function in A eg:</p>
  
  <pre><code>functionA () {
      functionB () {
          functionC () {
             #want to call functionA from here
          }
       }
   }
  </code></pre>
  
  <p>here is the code I am using:</p>
  
  <pre><code>updateProgress: function (statusurl){
      axios({
        method: 'get',
        url: statusurl,
        dataType: 'json',
        headers: {'Content-Type': 'application/json; charset=utf-8'},
        async: true,
        data: {}
      })
        .then(function (response) {
          var data = response.data
          if (data['state'] !== 'PENDING' &amp;&amp; data['state'] !== 'PROGRESS') {
            if ('result' in data) {
              // show result
              console.log('result: ' + data['result'])
            }
            else {
              // something unexpected happened
              console.log('state: ' + data['state'])
            }
          }
          else {
            // rerun in 2 seconds
            setTimeout(function() {
              this.updateProgress(statusurl)
            }, 2000)
          }
        }.bind(this))
        .catch(e =&gt; {
          console.log('error: ' + e)
        })
  </code></pre>
  
  <p>As you can see I am using this.functionA from functionC and bind() on functionA.</p>
  
  <p>I get the following error in the console:</p>
  
  <pre><code>Uncaught TypeError: this.updateProgress is not a function at eval 
  </code></pre>
  
  <p>Any idea on how to do this?</p>