Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fourlabsldn/x-div
https://github.com/fourlabsldn/x-div
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/fourlabsldn/x-div
- Owner: fourlabsldn
- Created: 2016-02-25T13:25:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-20T14:28:09.000Z (over 7 years ago)
- Last Synced: 2024-04-24T13:27:36.376Z (7 months ago)
- Language: JavaScript
- Size: 8.77 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# x-div Web Component
Check for browser compatibility [here](http://caniuse.com/#feat=custom-elements "can I use: custom elements").
Use it like:
**myPage.html**
```html
```
***mycontroller.js***
```javascript
xController(function (element){
var whoisThis = (this === element) ? true : false; //true;
});
```The xController receives a callback which receives the element it is inserted
into as an argument.## Installation
**NPM**
```
npm install x-div
```
**Bower**```
bower install x-div
```## Testing
To test your x-div components just load `x-div-tester.js` instead of `x-div.js`
and load your controller file with a `` tag. The tester will not execute
your component immediately, but store if to be executed by the test code.Execute your component with `xDivTester.callWith()`, and provire an HTMLElement
as a parameter to be the target of the execution