Reputation: 1
I have Visual Studio 2015 and I'm trying to use typescript. I copied the example from typescript playground at: http://www.typescriptlang.org/Playground
and I'm seeing the following warning: Expected '('.
this is the code:
<script>
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
var greeter = new Greeter("world");
var button = document.createElement('button');
button.textContent = "Say Hello";
button.onclick = function() {
alert(greeter.greet());
}
document.body.appendChild(button);
</script>
please help
Upvotes: 0
Views: 143