Skip to content

Instantly share code, notes, and snippets.

@lukehoban
Last active October 10, 2017 03:33
Show Gist options
  • Save lukehoban/47002bdf350998607cda818de020db93 to your computer and use it in GitHub Desktop.
Save lukehoban/47002bdf350998607cda818de020db93 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<head>
<title>JavascriptWebClient</title>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.js" type="text/javascript"></script>
</head>
<body>
<h1>Employee Pay</h1>
<br/>
<h3>SalesEmployee's are paid: <span id='salesEmployeePay'></span></h3>
<div id='results'></div>
<script type='text/strada'>
extern var $;
class Employee(string name, double basepay) {
public double calculatePay() {
return basepay;
}
}
class SalesEmployee(string name, double basepay, double salesbonus) : Employee(name, basepay) {
public string getName() { return name; }
public double calculatePay() {
return base.calculatePay() + salesbonus;
}
}
var employee = new Employee('Bob', 1000);
var salesEmployee = new SalesEmployee('Jim', 800, 400);
$('#salesEmployeePay').html(salesEmployee.calculatePay());
</script>
<!-- Load the Strada compiler to processs text/strada tags -->
<script src='StradaCompiler.js' type="text/javascript"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment