title: Manually and auto assigning constructor parameters in TypeScript
body: <p>The following code is what I always use to defined a constructor in <code>TypeScript</code> so far.</p>
  
  <pre><code>export class DashboardComponent {
      private heroService: HeroService;
      constructor(heroService: HeroService){
          this.heroService = heroService
      }
  }  
  </code></pre>
  
  <p>But recently when I check the <code>Angular 2</code> <a href="https://angular.io/docs/ts/latest/tutorial/toh-pt5.html" rel="nofollow">document</a>, I saw the syntax is shorter and look like </p>
  
  <pre><code>export class DashboardComponent {
      constructor(private heroService: HeroService){}
  }   
  </code></pre>
  
  <p>And the compiled JavaScript is the same</p>
  
  <pre><code>var DashboardComponent = (function () {
      function DashboardComponent(heroService) {
          this.heroService = heroService;
      }
      return DashboardComponent;
  }());
  </code></pre>
  
  <p>Because on the <code>TypeScript</code> <a href="http://www.typescriptlang.org/docs/handbook/classes.html" rel="nofollow">docs</a> only show the first type so I just want to make sure that two is the same and I am doing correctly with both of those types. </p>
  
  <p>Appreciate If someone can help me to confirm it?</p>