-
-
Save deap82/63cf42d8d753cdf62ff2c8c466a4f61e to your computer and use it in GitHub Desktop.
aurelia-binding unicode escaping
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> | |
| <h1>${message}</h1> | |
| </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 { inject, Aurelia, TemplatingEngine } from 'aurelia-framework'; | |
| @inject(Aurelia, TemplatingEngine) | |
| export class App { | |
| message = 'Hello \u000b World!'; | |
| templatingEngine; | |
| constructor(aurelia, templatingEngine) { | |
| this.aurelia = aurelia; | |
| this.templatingEngine = templatingEngine; | |
| } | |
| attached() { | |
| var enhanceInstruction = { | |
| container: this.aurelia.container, | |
| resources: this.aurelia.resources, | |
| bindingContext: { "message": "Hello \u000b World!" }, | |
| element: document.getElementById('enhanced') | |
| }; | |
| this.templatingEngine.enhance(enhanceInstruction); | |
| } | |
| } |
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> | |
| <div 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> | |
| </div> | |
| <div id="enhanced" style="border: dashed gray 1px; padding: 10px; margin-top: 20px;"> | |
| This area is enhanced.<br> | |
| ${ message } | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment