Abstract Optional html: stringThe html as a string to be used as the body of this component
Optional css: stringThe css as a string to be used as the style of this component
Creates an instance of WebzComponent.
WebzComponent
Private cssThe css as a string to be used as the style of this component
Private htmlThe html as a string to be used as the body of this component
Private htmlPrivate shadowPrivate stylesPrivate templateStatic Private resizeThe component to add
The id of the element to append the component to (optional)
void
Add a component to the dom
WebzComponent
component.addComponent(childComponent);
component.addComponent(childComponent, "myDiv");
The id of the element to append the router to (optional)
the router
Add a router to the component
WebzComponent
component.addRouter(router);
Protected removeWebzComponent
Remove a component from the dom
WebzComponent
component.addComponent(childComponent);
component.removeComponent(childComponent);
Static ajaxThe URL to make the AJAX call to
The HTTP method to use (GET or POST)
The headers to send with the request (optional)
Optional data: anyThe data to send in the request body (optional)
A promise that resolves with the response data
Makes an AJAX call
WebzComponent
myComponent.ajax("https://some.api.url.com/posts", HttpMethod.GET)
.subscribe((data) => {
console.log(data);
}, (error) => {
console.error(error);
});
Generated using TypeDoc
Description
A base class for creating web components
Export
Abstract
WebzComponent
Example