mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
29 lines
509 B
TypeScript
29 lines
509 B
TypeScript
|
|
|
|
import SpacePen = require("space-pen");
|
|
import View = SpacePen.View;
|
|
|
|
class Spacecraft extends View {
|
|
static content() {
|
|
this.div(()=> {
|
|
this.h1("Spacecraft");
|
|
this.ol(()=> {
|
|
this.li("Apollo");
|
|
this.li("Soyuz");
|
|
this.li("Space Shuttle");
|
|
});
|
|
});
|
|
}
|
|
|
|
constructor() {
|
|
super();
|
|
}
|
|
}
|
|
|
|
var view = new Spacecraft();
|
|
(<JQuery><any>view).find('ol').append('<li>Star Destroyer</li>');
|
|
|
|
(<JQuery><any>view).on('click', 'li', function () {
|
|
alert("They clicked on " + $(this).text());
|
|
});
|