A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.
A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.
The changed properties.
OptionaloverlayOptionalcontentOptionalcustom
PollModal - Modal for creating, voting, and managing live polls
Component
Description
Allows hosts to create/end polls and participants to vote on active polls. Supports multiple-choice questions with real-time result updates.
Supports three levels of customization:
Key Features:
Selector
app-poll-modal
Standalone
true
Imports
CommonModule, FontAwesomeModule, FormsModule
Input
isPollModalVisible - Whether the modal is currently visible. Default:
falseInput
onClose - Callback function to close the modal. Default:
() => {}Input
position - Modal position on screen ('topRight', 'center', etc.). Default:
'topRight'Input
backgroundColor - Background color of the modal content. Default:
'#83c0e9'Input
member - Name/ID of current participant. Default:
''Input
islevel - User level/role ('0' for host, '2' for participant). Default:
'2'Input
polls - Array of all poll objects. Default:
[]Input
poll - Currently active poll object. Default:
nullInput
socket - Socket.io client instance for real-time communication. Default:
undefinedInput
roomName - Name of the room/session. Default:
''Input
showAlert - Optional alert function for displaying messages. Default:
undefinedInput
updateIsPollModalVisible - Function to update modal visibility. Default:
() => {}Input
handleCreatePoll - Function to create new poll. Default:
() => {}Input
handleEndPoll - Function to end active poll. Default:
() => {}Input
handleVotePoll - Function to submit vote. Default:
() => {}Input
overlayStyle - Custom CSS styles for the modal overlay backdrop. Default:
undefinedInput
contentStyle - Custom CSS styles for the modal content container. Default:
undefinedInput
customTemplate - Custom TemplateRef to completely replace default modal template. Default:
undefinedMethod
ngOnInit - Initializes component state
Method
ngOnChanges - Updates poll state when inputs change
Method
getCombinedOverlayStyle - Merges default and custom overlay styles
Method
getCombinedContentStyle - Merges default and custom content styles