Module
The main class, used to create a Modux module. You can think of this as the main application
Constructor Summary
Public Constructor | ||
public |
constructor(name: String) Creates an instance of Module |
Member Summary
Public Members | ||
public |
store: Store Contains a new instance of @crispcode/pushstore which is passed on to all components. |
Method Summary
Public Methods | ||
public |
addDependency(name: String, dependency: Component): Module A method used to add components to the Module |
|
public |
Initializes the Module on a specific HTMLElement and loads the specified Component for it |
|
public |
createComponent(node: HTMLElement) Renders an HTMLElement to a Component as if it was a part of this module |
|
public |
destroy() Destroy the current module. |
|
public |
removeDependency(name: String): Module A method used to remove components from the Module |
Public Constructors
Public Members
public store: Store source
Contains a new instance of @crispcode/pushstore which is passed on to all components. See https://www.npmjs.com/package/@crispcode/pushstore
Public Methods
public addDependency(name: String, dependency: Component): Module source
A method used to add components to the Module
public bootstrap(element: HTMLElement, component: Component) source
Initializes the Module on a specific HTMLElement and loads the specified Component for it
Params:
Name | Type | Attribute | Description |
element | HTMLElement | The HTMLElement used as the wrapper for the Module |
|
component | Component | The Component to be used as the main Component |
public createComponent(node: HTMLElement) source
Renders an HTMLElement to a Component as if it was a part of this module
Params:
Name | Type | Attribute | Description |
node | HTMLElement | The HTMLElement to be converted to a Component |
public destroy() source
Destroy the current module. This will also destroy all the components created and disconnect the MutationObserver