Basic usage
Create the alert UI
the DaisyUI library provides a alert
component that can be used to display a message to the user.
Instructions
-
Update the template of
alert-banner.component.ts
file:<div role="alert" class="alert alert-vertical alert-info alert-soft"><span>12 unread messages. Tap to see.</span><div><button class="btn btn-sm">Deny</button><button class="btn btn-sm btn-primary">Accept</button></div></div>
Display the component
Let’s now display the banner in the TaskList
and TaskForm
components.
Instructions
-
Update the template of
task-list.component.ts
file:<app-alert-banner /> -
Update the template of
task-form.component.ts
file:<app-alert-banner /> -
Test the application.
You should see the banner displayed in both components.