Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
html-custom-elements
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JadeProListening
html-custom-elements
Commits
eb0163f5
Commit
eb0163f5
authored
Sep 21, 2016
by
Stephanus Volke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update README.md
parent
607d3b84
Pipeline
#712
passed with stages
in 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
27 deletions
+3
-27
README.md
README.md
+3
-27
No files found.
README.md
View file @
eb0163f5
...
...
@@ -12,14 +12,14 @@ observing other elements attribute changes.
> is used, which is currently supported only by the latest Google Chrome
> Browser.
## Installation
## Installation
and usage
The HTMLCustomElements were built with a flexible, modular usage in
mind. For that, each class is provided as a single ES6 module. Because
until now there is no browser supporting es6 modules natively, we
suggest the following two usage scenarios.
## Standalone installation
##
#
Standalone installation
You can download one of the releases which can be found in the gitlab repository.
These are precompiled versions of the whole project.
...
...
@@ -51,7 +51,7 @@ window.customElements.define('my-element', MyElement);
The disadvantage of this way is, that the builds contain the whole
project and not only the parts you really need.
## Installation in other projects
##
#
Installation in other projects
For easy usage the HTMLCustomElements project is designed as an npm
package. Until now is it not registered in the official node package
...
...
@@ -88,30 +88,6 @@ class MyElement extends HTMLCustomElement {
// register your element
window
.
customElements
.
define
(
'my-element'
,
MyElement
);
```
## Usage
``` javascript
// import class via es6 module syntax
import {HTMLCustomElement} from 'path/to/this/class'
// instead of extending the `HTMLElement` interface
// use the `HTMLCustomElement` class
class MyElement extends HTMLCustomElement {
constructor() {
super(); //instantiate parent class
// your code
}
// other methods
}
// register your element
window.customElements.define('my-element', MyElement);
```
To view the results you have to bundle your javascript once again with
an aviable tool like
[
rollup
](
http://rollupjs.org
)
,
[
webpack
](
https://webpack.github.io/
)
or something like that.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment