Skip to content

Instantly share code, notes, and snippets.

@len-ro
Last active August 22, 2016 09:43
Show Gist options
  • Save len-ro/e7b079763ddf2c43587d88171d5ff82b to your computer and use it in GitHub Desktop.
Save len-ro/e7b079763ddf2c43587d88171d5ff82b to your computer and use it in GitHub Desktop.
Menu: basic usage
<template>
${trade.a}
${trade.b}
<input id="datepicker" ak-datepicker="k-value.two-way:trade.valueDate" style="width: 100%" />
<input id="amount" type="number" ak-numerictextbox="k-value.two-way : trade.amount" style="width: 100%;"/>
<button type="button" click.delegate="onNew(event)">New</button>
<button type="button" click.delegate="onLoad(event)">Load</button>
</template>
export class BasicUse {
trade = null;
onNew(){
this.trade = {};
}
onLoad(){
let rand = Math.floor(Math.random() * 20);
this.trade = { a: 'aValue-' + rand, b: 'bValue-' + rand, valueDate: this.randomDate(), amount: rand };
}
randomDate() {
let start = new Date(2012, 0, 1);
let end = new Date();
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
}
}
<!doctype html>
<html>
<head>
<title>Aurelia KendoUI bridge</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.common.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.default.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.mobile.all.min.css">
<script src="https://kendo.cdn.telerik.com/2016.1.226/js/jszip.min.js"></script>
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/0.3.5/config2.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-kendoui-bridge', kendo => kendo.pro());
aurelia.start().then(a => a.setRoot());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment