console.log not working in Angular2 Component (Typescript)
<p>I am relatively new to both Angular2 and typescript. Since typescript is a superset of javascript, I'd expect functions like <code>console.log</code> to work. <code>console.log</code> works perfectly in <code>.ts</code> files when outside a component class but does not work as I'd expect from inside the component class.</p>

<pre><code>// main.ts

import { Component } from '@angular/core';
console.log("Hello1"); //1. This works perfectly

@Component({..)
export class App {
 s: string = "Hello2";
 // console.log(s); //2. This gives compilation error (when uncommented)
 // Error: Function implementation is missing or not immediately following the declaration.
}
</code></pre>

<p>Is there anything that I am missing?</p>