@daltonr/notifywrite-angular
v0.3.0
Published
Angular adapter for @daltonr/notifywrite
Maintainers
Readme
@daltonr/notifywrite-angular
Angular adapter for @daltonr/notifywrite — the headless notification engine as an Angular Signal. Works with zoneless change detection.
npm install @daltonr/notifywrite @daltonr/notifywrite-angular// main.ts
bootstrapApplication(AppComponent, {
providers: [provideNotifications(new NotificationEngine({ order: "newest-first" }))],
});
// any component
import { injectNotifications } from "@daltonr/notifywrite-angular";
@Component({
template: `@for (n of notifications(); track n.id) { <div (click)="dismiss(n.id)">{{ n.message }}</div> }`,
})
export class ToastsComponent {
private notif = injectNotifications();
notifications = this.notif.notifications;
dismiss = this.notif.dismiss;
}An RxJS fromEngine(engine) Observable is also exported. See the project README for the full engine API.
MIT © Richard Dalton
