Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (35 sloc) 961 Bytes
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="http://api.webfan.de/api-d/4/js-api/library.js"></script>
</head>
<body>
<script type="text/typescript" src="http://frdl.webfan.de/cdn/application/webfan/node_modules/typescript/tttest.ts">
export class Auto {
private kilometer: number = 0;
constructor(public modell, public baujahr){}
public fahren(km: number){
this.kilometer += km;
}
public getKilometer(){
return this.kilometer;
}
}
interface Fahrzeug {
modell: string;
baujahr: number;
getKilometer: () => {};
}
var karre = new Auto('VW Käfer', 1984);
karre.fahren(20);
function describe(auto: Fahrzeug) {
return "Ein " + auto.baujahr + "er " + auto.modell +
" mit " + auto.getKilometer() + "km auf der Uhr";
}
alert('Test typescript inline: '+ describe(karre));
</script>
<p>Testing typescript script tag (src, innerHTML).</p>
<p>Read the source code!</p>
</body>
</html>