Optional
html: string = ""The html as a string to be used as the body of this component
Optional
css: string = ""The css as a string to be used as the style of this component
Creates an instance of WebzDialog.
WebzDialog
const dlg = new WebzDialog("<h1>Hello World</h1>", "h1{color:red;}");
Private
backgroundPrivate
closePrivate
popupStatic
Private
popupThe 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);
});
Static
clickStatic
popupThe component to attach the dialog to
The message to display
Optional
title: string = "Alert"The title of the dialog
Optional
buttons: string[] = ...The buttons to display
Optional
btnClass: string = ""The class to apply to the buttons
The event subject that is triggered when the dialog is closed
Show a popup dialog
WebzDialog
WebzDialog.popup("Hello World", "Alert", ["Ok","Cancel"], "btn btn-primary")
.subscribe((value:string) => {
if (value === "Ok") console.log("Ok was clicked");
else console.log("Cancel was clicked");
});
Generated using TypeDoc
Description
A dialog component that can be used to create a popup dialog
Export
WebzDialog
Example