-
Notifications
You must be signed in to change notification settings - Fork 7
Class: ConfirmBoxInitializer
This is the class that needs to be instantiated to set up and ignite a ConfirmBox and create content. Its purpose is to get confirmation response from end-user. It can be called from any angular typescript file.
Below is example with (some optional) user configuration, it will override default configuration from app.module.
Example:
// Create the initializer.
const newConfirmBox = new ConfirmBoxInitializer();
// Set desired dispatch: _Title: string, _Message: string.
newConfirmBox.setDispatch('Are you sure?', 'That action will delete user!');
// Set desired configuration.
newConfirmBox.setConfig({
layoutType: DialogLayoutDisplay.DANGER
});
// Set button labels.
newConfirmBox.setButtonLabels('YES', 'NO');
// Open a ConfirmBox, and get clicked button-id in response.
newConfirmBox.openConfirmBox$().subscribe(resp => {
// IConfirmBoxPublicResponse
console.log('confirmBox response: ', resp);
});
- IConfirmBoxCoreConfig: IConfirmBoxCoreConfig
- layoutType: DialogLayoutDisplay
- IConfirmBoxPublicResponse: IConfirmBoxPublicResponse
+ new ConfirmBoxInitializer(): ConfirmBoxInitializer
Returns: ConfirmBoxInitializer
▸ openConfirmBox$(): Observable<IConfirmBoxPublicResponse>
Returns: Observable<IConfirmBoxPublicResponse>
▸ setButtonLabels(_Confirm
: string, _Decline?
: string): void
Name | Type |
---|---|
_Confirm |
string |
_Decline? |
string |
Returns: void
▸ setButtons(_Buttons
: IButton[]): void
Name | Type |
---|---|
_Buttons |
IButton[] |
Returns: void
▸ setConfig(_ConfirmBoxCoreConfig
: IConfirmBoxCoreConfig): void
Name | Type |
---|---|
_ConfirmBoxCoreConfig |
IConfirmBoxCoreConfig |
Returns: void
▸ setDispatch(_Title
: string, _Message?
: string): void
Name | Type | Default value |
---|---|---|
_Title |
string | - |
_Message |
string | null |
Returns: void
▸ setMessage(_Message
: string): void
Name | Type |
---|---|
_Message |
string |
Returns: void
▸ setTitle(_Title
: string): void
Name | Type |
---|---|
_Title |
string |
Returns: void
- AppearanceAnimation
- ButtonLayoutDisplay
- DialogLayoutDisplay
- DisappearanceAnimation
- ToastPositionEnum
- ToastProgressBarEnum
- ToastUserViewTypeEnum