title: Passing a parameter into a lambda style callbcak
body: <p>Hello I am trying to pass a parameter into a callback to a service that i have. I will change things up a bit here, but the idea will be the same.</p>
  
  <p>I have a button that is called from the web ui.</p>
  
  <pre><code>&lt;button (click)="doSomeWork(modal)"&gt;Button Name&lt;/button&gt;
  </code></pre>
  
  <p>In the component I have this method.and have a service called <code>thisService</code></p>
  
  <pre><code>private doSomeWork(modal){
       const message = 'Are you sure you want to do work, its coffee time!'
       this.thisService(()=&gt;{
          // do some work here
          modal.close();
       },message);
  }
  </code></pre>
  
  <p>Everything works from here except <code>modal.close()</code>, but this does work if it's outside of the callback so i can only assume that this is do to no reference to the modal. All of that said, there are not any errors that are thrown either. </p>
  
  <p>If i do this i do get an error.</p>
  
  <pre><code>private doSomeWork(modal){
           const message = 'Are you sure you want to do work, its coffee time!'
           this.thisService((modal)=&gt;{
              // do some work here
              modal.close();
           },message);
      }
  </code></pre>
  
  <p>The modal is no longer a modal but now an event so we cannot  pass in this way.</p>