-
-
Save Reverbe/672dd45b0508bfe80de6039c99c573a4 to your computer and use it in GitHub Desktop.
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> | |
<label repeat.for="option of options"> | |
<input type="radio" name="periodOptions" model.bind="option" checked.bind="$parent.selectedOption" click.delegate="clicked()"/> | |
${option.text} | |
</label> | |
<p><pre><code>${selectedOption | stringify}</code></pre></p> | |
</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
import {computedFrom} from 'aurelia-framework'; | |
export class PeriodPanel { | |
heading = 'Tidsperiode'; | |
tt = 'asdasd'; | |
options = []; | |
selectedOption = {}; | |
@computedFrom('selectedOption') | |
get computedprop() { | |
console.log('sa schimbat'); | |
console.log(this.selectedOption.id); | |
return this.selectedOption.id; | |
} | |
constructor() { | |
this.options = [ | |
{id:1, text:'Vis med dagoppløsning'}, | |
{id:2, text:'Vis med timeoppløsning'}, | |
{id:3, text:'Vis periode'} | |
]; | |
this.selectedOption = this.options[0]; | |
} | |
clicked() { | |
console.log(this.selectedOption.id); | |
return true; | |
} | |
} | |
export class StringifyValueConverter { | |
toView(value) { | |
return JSON.stringify(value, null, 2); | |
} | |
} |
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> |
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
/******************************************************************************* | |
* The following two lines enable async/await without using babel's | |
* "runtime" transformer. | |
* | |
* More info here: https://github.com/jdanyow/aurelia-plunker/issues/2 | |
* | |
* Feel free to remove these lines if your plunker doesn't use async/await. | |
*/ | |
import regeneratorRuntime from 'babel-runtime/regenerator'; | |
window.regeneratorRuntime = regeneratorRuntime; | |
/******************************************************************************/ | |
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging(); | |
aurelia.start().then(a => a.setRoot()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment