A Polymer element providing an accountbar to manage user account actions in Hoodie.
This element is still a work in progress. Code for all of the functionality is present, but not all of it is working correctly yet, as is described in the open issues on GitHub.
Online docs & demo are at http://timblack1.github.io/hoodie-accountbar/.
$ bower install --save hoodie-accountbar
$ # Optionally, install <hoodie-service> to provide the `hoodie` object
$ bower install --save hoodie-service
Import hoodie-accountbar (and optionally, hoodie-service) into the <head>
of your Polymer element or elements.html
file:
<head>
<link rel="import" href="../../hoodie-service/hoodie-service.html">
<link rel="import" href="../../hoodie-accountbar/hoodie-accountbar.html">
</head>
Place the hoodie-accountbar (and optionally, hoodie-service) element where you would like it to appear in the context of your app:
<hoodie-service hoodie="{{hoodie}}"></hoodie-service>
<hoodie-accountbar hoodie="{{hoodie}}"></hoodie-accountbar>
Use Hoodie in your code:
<script>
(function() {
Polymer({
attached:function(){
this.async(function(){
var thiz = this;
// Get selected_colors from a user preference
this.hoodie.store.find('preferences', 'selected-colors')
.then(function(selected_colors){
thiz.selected_colors = selected_colors.colors;
});
});
}
});
});
</script>
Run the following commands to set up a development environment to improve hoodie-accountbar:
$ npm install -g polyserve && npm install && bower install
$ npm start
Navigate to http://localhost:8080/components/hoodie-accountbar/ to see the component's docs and demo.
You can run the integration tests in one of two ways:
-
From the command line: Run
npm test
. -
In your browser: Run
npm start
and navigate to http://localhost:8080/components/hoodie-accountbar/test/index.html.