Repository navigation
Notifications
zehavibarak edited this page Feb 15, 2025
·
2 revisions
Send a notification to user.
Backing server-side.
[Notification(Template = "app-my-message", Title = "My Message")]
public class MyMessage : NotificationBase<MyMessageModel> {
}
public record MyMessageModel {
public string Text { get; set; }
}Utilize INotificationDispatcher.
public class MyClass(INotificationDispatcher notificationDispatcher) {
public async Task SendAsync() {
await notificationDispatcher.SendAsymc(new MyMessageModel {
Text = "Message!"
}, "user-identity");
}
}Angular
import { InsightComponent, DocumentModel } from '@bizdoc/core';
@Component({ template: `{{message}}` })
@BizDoc({ name: 'app-my-message' })
export class AppComponent implements NotificationComponent<MyMessageModel> {
message: string;
onBind(model: MyMessageModel) {
this.message = model.text;
}
}Moding Ltd.