Last active
December 20, 2015 01:19
-
-
Save addyosmani/6048703 to your computer and use it in GitHub Desktop.
Aura homepage
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
<!-- Define a DOM-element with a data-aura-component attribute and Aura will bring it to life on start --> | |
<div data-aura-component="hello"></div> | |
<!-- Define as many of these component instances as you wish --> | |
<div data-aura-component="hello"></div> | |
<div data-aura-component="goodbye"></div> | |
<!-- You can also pass options to your component via data-attributes. --> | |
<div data-aura-component="hello" data-aura-foo="bar" data-aura-other-option="hello again"></div> | |
<!-- These will then be available in your component instance as: --> | |
this.options.foo // -> bar | |
this.options.otherOption // -> hello again | |
<!-- Aura also comes with the awesome ability to load components on demand from different sources --> | |
aura({ | |
sources: { default: 'https://another.doma.in/path/to/my/components' } | |
}).start(); | |
<!-- The Aura Mediator then allows components to communicate with each other by subscribing, | |
unsubscribing and emitting sandboxed event notifications. e.g: --> | |
sandbox.on(name, listener, context) | |
sandbox.once(name, listener, context) | |
sandbox.off(name, listener) | |
sandbox.emit(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment