Installation
Installation
Before you can use the flowbased-polymer behavior you need to install it in your project.
bower install flowbased-polymer --save
Import the behavior in your component
<link rel="import" href="../flowbased-polymer/behaviour.html">
OR
<link rel="import" href="../bower_components/flowbased-polymer/behaviour.html">
OR
<link rel="import" href="../bower_components/flowbased-polymer/mixin.html">
###Add the behaviour to your component
Polymer 2.x
<link rel="import" href="../bower_components/flowbased-polymer/mixin.html">
<script>
class MyComponent extends FBPMixin(Polymer.Element) {
static get is() { return 'my-view1'; }
}
window.customElements.define(MyComponent.is, MyComponent);
</script>
or Polymer 2.x
<script>
class MyComponent extends Polymer.mixinBehaviors([ Polymer.FlowBasedProgramming], Polymer.Element){
static get is() { return 'my-view1'; }
}
window.customElements.define(MyComponent.is, MyComponent);
</script>
Polymer 1.x
{
behaviors: [Polymer.FlowBasedProgramming]
}
Tipp
Do not forget to import and define the behaviour. It is a common pitfall to forget the definition or the import in the component you are writing.