18 lines
258 B
TypeScript
18 lines
258 B
TypeScript
|
class CalcButton
|
||
|
{
|
||
|
public a() { this.onClick(); }
|
||
|
public onClick() { }
|
||
|
}
|
||
|
|
||
|
class CalcButton2
|
||
|
{
|
||
|
public b() { () => this.onClick(); }
|
||
|
public onClick() { }
|
||
|
}
|
||
|
|
||
|
var c = new CalcButton();
|
||
|
c.a();
|
||
|
var c2 = new CalcButton2();
|
||
|
c2.b();
|
||
|
|