Last active
July 7, 2017 13:44
-
-
Save ZoolWay/cb945f08daa0d53e89d34512a79a38e6 to your computer and use it in GitHub Desktop.
Aurelia I18N update-value
This file contains hidden or 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="my-comp"></require> | |
<h1>Aurelia I18N update-value</h1> | |
<my-comp title="simple"></my-comp> | |
<p>${'client:title' & t}</p> | |
</template> |
This file contains hidden or 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 { observable } from 'aurelia-framework' | |
export class App { | |
modelB = { title: 'inner-compose' }; | |
areaContainer = null; | |
} |
This file contains hidden or 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="main"> | |
<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 hidden or 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
{ | |
"title": "Translated-Title", | |
"text": "Translated-Text" | |
} |
This file contains hidden or 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 'https://unpkg.com/[email protected]' | |
import 'https://unpkg.com/[email protected]/dist/es/index' | |
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.plugin('https://unpkg.com/[email protected]/dist/aurelia-i18n', (instance) => { | |
let aliases = ['t', 'i18n']; | |
TCustomAttribute.configureAliases(aliases); | |
return instance.setup({ | |
lng: 'en', | |
attributes: aliases, | |
ns: ['client'], | |
defaultNS: 'client', | |
debug: false | |
}); | |
}) | |
; | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
This file contains hidden or 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 style="font-family:Lucida Console Regular; padding: 1em; background: silver;"> | |
title: '${title}' | |
</div> | |
</template> |
This file contains hidden or 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 { bindable } from 'aurelia-framework' | |
export class MyComp { | |
@bindable title = null; | |
activate(model) { | |
if ((model) && (model.title)) { | |
this.title = model.title; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment