title: Function within Class accessing 'this'
body: <p>This is a very basic example of the function I'm trying to achieve. My problem is that when calling 'greet', appConfig will not exist on 'this' since it's inside the function. </p>
  
  <p>How can I maintain access to the outer 'this' and be able to call appConfig? I'm hoping to do this without assigning the outer 'this' to some variable like self. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Greeter {
   
   static $inject = ['appConfig'];
      constructor(
    private appConfig: any
   ) {
      }
   
      greet() {
          return getMessage();
    
    function getMessage() { 
     return this.appConfig.value;
    }
   }
  }</code></pre>
  </div>
  </div>
  </p>