Last active
March 6, 2016 04:50
-
-
Save jdanyow/6af6cf41d4f8dc206aaa to your computer and use it in GitHub Desktop.
Numeral - All languages
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> | |
<require from="./currency-value-converter"></require> | |
<label> | |
Language: | |
<select value.bind="selectedLanguage"> | |
<option repeat.for="language of languages" value.bind="language">${language}</option> | |
</select> | |
</label> | |
<h1>${value | currency:selectedLanguage}</h1> | |
</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 { | |
value = 1234567.890123; | |
selectedLanguage = 'nl-nl'; | |
languages = [ | |
'en-gb', | |
'es', | |
'et', | |
'fi', | |
'fr', | |
'fr-CA', | |
'fr-ch', | |
'hu', | |
'it', | |
'ja', | |
'nl-nl', | |
'pl', | |
'pt-br', | |
'pt-pt', | |
'ru', | |
'ru-UA', | |
'sk', | |
'th', | |
'tr', | |
'uk-UA', | |
'be-nl', | |
'chs', | |
'cs', | |
'da-dk', | |
'de', | |
'de-ch']; | |
} |
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 numeral from 'numeral'; | |
import 'numeral/min/languages.min'; | |
export class CurrencyValueConverter { | |
toView(value, language = 'nl-nl') { | |
numeral.language(language); | |
return numeral(value).format('$0,0.00'); | |
} | |
} |
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> | |
<link rel="stylesheet" href="styles.css"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body aurelia-app="main"> | |
<h1>Loading...</h1> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script> | |
<script> | |
System.import('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. 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(); | |
aurelia.start().then(a => a.setRoot()); | |
} |
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
/* Styles go here */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment