Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit fa8b713

Browse files
committed
why can it compile
1 parent 856a312 commit fa8b713

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

app/main.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
import {bootstrap} from 'angular2/platform/browser';
22
import {AppComponent} from './app.component';
33

4+
class Cat {
5+
name: string;
6+
age: number;
7+
8+
constructor(name: string) {
9+
this.name = name;
10+
}
11+
12+
greet(): void {
13+
console.log("I am " + this.name);
14+
}
15+
}
16+
17+
var cat1 = new Cat("tama");
18+
cat1.greet();
19+
20+
var cat2 = {
21+
name: "mike",
22+
age: 3
23+
};
24+
cat2.greet();
25+
26+
var cat3 = {
27+
namae: "hoge",
28+
hage: 4
29+
};
30+
cat3.greet();
31+
432
bootstrap(AppComponent);

0 commit comments

Comments
 (0)