Polymer mixin to support microdata properties.
npm install polymer-microdatash
> npm install polymer-microdata --save
`
You can then decorate your custom elements as follows:
`js
import { MicrodataMixin } from '../polymer-microdata.js'
import { PolymerElement, html } from '../../@polymer/polymer/polymer-element.js'
class MyMicrodataElement extends MicrodataMixin(PolymerElement) {
static get is() { return 'my-microdata-element' }
static get template() {
return html{{name}}
}
static get properties() {
return {
name: {
type: String
}
}
}
}
customElements.define(MyMicrodataElement.is, MyMicrodataElement)
`
You can then populate your element properties using microdata syntax as follows:
`html
my-name
`
This should render as:
`html
my-name
`
Hacking
To modify polymer-microdata you need the following installed:
* Node
* Polymer CLI
Once you've cloned the repo run the following shell commands:
`shell
> npm install
`
You can run the tests as follows:
`shell
> npm test
`
Or you can run the test suite in your browser by running polymer serve --open and copy-and-pasting http://127.0.0.1:8081/components/polymer-microdata/test/` into your address bar.