Created
March 26, 2018 23:41
-
-
Save Alexander-Taran/8e30de178a6752fe06b115c63fd4ec1e to your computer and use it in GitHub Desktop.
Aurelia Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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