Skip to content

Instantly share code, notes, and snippets.

@Alexander-Taran
Created March 26, 2018 23:41
Show Gist options
  • Save Alexander-Taran/8e30de178a6752fe06b115c63fd4ec1e to your computer and use it in GitHub Desktop.
Save Alexander-Taran/8e30de178a6752fe06b115c63fd4ec1e to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<div class="row" repeat.for="option of options">
<div class="col">
<div class="form-group">
<div class="form-check">
<input checked.bind="option.showThis" change.delegate="saveMe(option,$index)" type="checkbox">
<label class="form-check-label">
${option.friendlyName}
</label>
</div>
</div>
</div>
</div>
</template>
export class App {
options= [];
message = 'Hello World!';
constructor(){
for(var i=0;i<10;i++){
this.options.push({showThis:true,friendlyName:`asd${i}`})
}
}
saveMe(option,index) {
alert(`saving ${JSON.stringify(option)} with index ${index}`)
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body aurelia-app>
<h1>Loading...</h1>
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script>
<script>
require(['aurelia-bootstrapper']);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment