title: Best practice for Angular 2 in TypeScript
body: <p>I'm trying to rewrite my app in Angular 2 typescript and would like to use best practices. I've found the following <a href="https://angular.io/docs/ts/latest/guide/style-guide.html" rel="nofollow">guide</a> but it doesn't answer my very basic questions. Here is two questions:</p>
  
  <ol>
  <li>In Components, is it ok to declare a local variable inside a function or should I declare it as private, right above the constructor?</li>
  <li><p>How should I call variables inside nested functions? For example:</p>
  
  <pre><code>replicator(){// return observable}
  myFunction(){// Nested function to be called}
  
  ngOnInit() {
      this.replicator().subscribe(function (data) {
          // Call function here
      }
  }
  </code></pre>
  
  <p>Should I call my function by doing: <code>let self = this</code> before <code>this.replicator()</code> and then call <code>self.myFunction()</code>? Or is there a better way to do this?</p></li>
  </ol>
  
  <p>PS If you have a good best practice guide, please post it as a comment!</p>