-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a7d3e8
commit dfe865c
Showing
11 changed files
with
21 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# Boilerplate for standalone & lightweight web component | ||
# Boilerplate for standalone & lightweight typescript component | ||
|
||
## Intro | ||
This repository contains a minimal set of code required to create your own web component. It does not depend on any frameworks. | ||
One example can be found in /ExampleComponent.ts. | ||
This repository contains a minimal set of code required to create your own typescript application. It does not depend on any frameworks. No global dependencies are required! | ||
|
||
## Install | ||
``` | ||
|
@@ -16,35 +15,14 @@ npm run build | |
``` | ||
|
||
## Running | ||
This script will build and run the server. | ||
This script will build and run the application. | ||
``` | ||
npm run start | ||
``` | ||
|
||
## Example Integration | ||
```html | ||
<html> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body> | ||
<div id="ath-component"></div> | ||
|
||
<script type="text/javascript" src="./ath-component.js"> | ||
window.athComponent.bootstrap({ | ||
domID: "ath-component", | ||
apiUrl: "https://alphateamhackers.com" | ||
}) | ||
</script> | ||
</body> | ||
</html> | ||
``` | ||
|
||
## Developers | ||
* [Alphateam Hackers GmbH](https://alphateamhackers.com) | ||
|
||
[email protected] | ||
|
||
* [Adrian Barwicki](https://adrianbarwicki.com) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
|
||
import ExampleComponent from "./ExampleComponent"; | ||
import { ATH } from "./types"; | ||
|
||
declare var window: any; | ||
declare var module: any; | ||
|
||
const athComponentRegister: ExampleComponent[] = []; | ||
|
||
const bootstrap = (opts: ATH.BootstrapOpts) => { | ||
opts = opts || {}; | ||
|
||
|
||
if (!opts.domID) { | ||
throw new Error("ATH Component: Missing 'domId' in initialization options."); | ||
} | ||
|
||
if (!opts.apiUrl) { | ||
throw new Error("ATH Component: Missing 'apiUrl' in initialization options."); | ||
} | ||
|
||
athComponentRegister.push(new ExampleComponent(opts.domID, opts.apiUrl)); | ||
export const start = () => { | ||
console.log("Hello world!"); | ||
}; | ||
|
||
window.athComponent = { | ||
bootstrap | ||
}; | ||
if (!module.parent) { | ||
start(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
|
||
export namespace ATH { | ||
export interface BootstrapOpts { | ||
domID?: string; | ||
apiUrl?: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.