Skip to content

openmusic/web-component-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openmusic-web-component-template

A template for OpenMusic Web Components

Install with NPM

Installation

Grab index.js from the repo or do npm install openmusic-web-component-template.

If not using any package manager

Include index.js before you use the component:

<script src="index.js"></script>

It will be registered automatically as openmusic-web-component-template, so you can document.createElement('openmusic-web-component-template') or just have <openmusic-web-component-template> elements in your HTML source.

If using npm

You need to load the module and then register it--it is not automatically registered!

require('openmusic-web-component-template').register('openmusic-web-component-template');

But you could even register it with other name, for example:

require('openmusic-web-component-template').register('mega-web-component-template');

Up to you.

Usage

Have a look at demo/demo.js for an example that does things in order to things.

Attributes

attribute

Explanation of attribute.

Examples:

<openmusic-web-component-template attribute="-1"></openmusic-web-component-template>

Events

event

This event will be dispatched when x happens. To listen for event events on this component, add an event listener:

component.addEventListener('event', function(ev) {
	var detail = ev.detail;
	// detail contains the values you want
});

About

A template for OpenMusic web components

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published