Skip to content

Instantly share code, notes, and snippets.

@Leonidnei
Last active April 25, 2016 12:44
Show Gist options
  • Save Leonidnei/ee5f863dc158ab894f61098a3440fb69 to your computer and use it in GitHub Desktop.
Save Leonidnei/ee5f863dc158ab894f61098a3440fb69 to your computer and use it in GitHub Desktop.
Aurelia - JQueryUI DatePicker
<template>
<button click.delegate="add()">add</button>
<button click.delegate="delete()">delete</button>
<div id="example">
<div repeat.for="item of x.data">
<div id='${$index}'>
${item.Title}
</div>
</div>
</div>
</template>
import {inject} from 'aurelia-framework';
import {X} from './x';
@inject (X)
export class App {
//data= [{Title: '0'}];
constructor(x){
this.x = x;
}
add(){
this.x.data.unshift({Title: this.x.data.length});
}
delete(){
this.x.data.splice(0,1);
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</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.4/config2.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
/*******************************************************************************
* The following two lines enable async/await without using babel's
* "runtime" transformer. Uncomment the lines if you intend to use async/await.
*
* More info here: https://github.com/jdanyow/aurelia-plunker/issues/2
*/
//import regeneratorRuntime from 'babel-runtime/regenerator';
//window.regeneratorRuntime = regeneratorRuntime;
/******************************************************************************/
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-kendoui-bridge', kendo => kendo.pro());
aurelia.start().then(a => a.setRoot());
}
export class X {
data= [{Title: '0'}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment