Skip to content

Instantly share code, notes, and snippets.

@addyosmani
Last active December 20, 2015 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save addyosmani/6048703 to your computer and use it in GitHub Desktop.
Save addyosmani/6048703 to your computer and use it in GitHub Desktop.
Aura homepage
<!-- 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