title: How do i correctly use angular $timeout service outside of a typescript constructor?
body: <p>I'm trying to figure out how to correctly use the angular $timeout service with TypeScript - So that i can show a splash-screen-like-behavior when someone for example clicks on a "Log In"-button.</p>
  
  <pre><code>interface INavigationController {
          username: string;
          password: string;
          loggedIn: boolean;
          ready: boolean;
          signIn(): void;
          signOut(): void;
      }
  
      class NavigationController implements INavigationController {
          username: string;
          password: string;
          loggedIn: boolean;
          ready: boolean;
  
          static $inject = ['$timeout'];
          constructor(private $timeout: ng.ITimeoutService) {
              var vm = this;
              vm.username = this.username;
              vm.password = this.password;
              vm.ready = true;
  
              // The line below work just fine from within here - but i want the behavior
              // when someone clicks a button, not directly like this.
              // Remove vm.ready = true above, before...
              //$timeout(function () { vm.ready = true;}, 2200);}
  
          signIn() {
              if (!this.username || !this.password) {
                  alert("You need to frickin enter som details, man!");
              } else {
                  this.ready = false;
                  this.$timeout(function () {
                      this.ready = true;
                  }, 2200);
              }
          }
  </code></pre>
  
  <p>I have also tried to set the <code>invokeApply?:boolean</code> to true:</p>
  
  <pre><code>this.$timeout(function () {
      this.ready = true;
  }, 2200, true);
  </code></pre>
  
  <p>- Without any success...</p>
  
  <p>If i <code>console.log(this.ready);</code> from within the <code>this.$timeout(function()...</code> it will show me <code>true</code> after 2200ms, but it seems that the <code>$apply()</code> doesn't apply?</p>
  
  <p>Would appreciate if someone could enlighten me in how to use the $timeout and other services like it, correctly - Preferably using the style-guide i'm aiming for i.e. using "controllerAs with vm" - <a href="https://github.com/johnpapa/angularjs-styleguide#controllers" rel="noreferrer">John Papa</a></p>