question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom button action in notification

See original GitHub issue

I tried the following code:

this._service.html('Are you sure?<br/><button md-button (click)="freeUser()">Yes</button>',"info");

Unfortunetly the click event not working, so my question is, if there is any way to make custom button with some action in a notification body?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
bertrandgcommented, Oct 11, 2017

hi, Here is an easy way to add button inside notification and bind it to an action: demo: https://angular-j9rrgn.stackblitz.io code: https://stackblitz.com/edit/angular-j9rrgn

And thanks @flauc for your great lib! 😃

3reactions
flauccommented, Aug 4, 2016

I’m working on a solution, but I’ve been short on time lately. Anyway the solution uses ViewContainerRef.createComponent() to dynamically create the provided component in side of the notification.

With this approach you could create a component and then pass it to the notification service. The only down side is that you will have to use a service to communicate with the component.

It would look something like this:

notificationsService.dynamic('success', MyComponent) 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding button action in custom notification - Stack Overflow
I have made custom notification and there is a button in that, I want to perform two different functionalities on notification and button...
Read more >
How to Use Action Buttons to Make Push Notifications Interactive
All you need to do is go to "New Message", select "Options", and add custom action buttons in the dashboard interface specific to...
Read more >
Declaring Your Actionable Notification Types - Apple Developer
Differentiate your notifications and add action buttons to the notification interface. ... Declare Your Custom Actions and Notification Types.
Read more >
Manage Notification button settings - Oracle Help Center
Adding Custom Interactive Notification buttons · In the Name field, type the button name. · In the ID field, type the button ID....
Read more >
Custom Notification Buttons - Airship Docs
Create a New Notification Button · Button Label: Identifies button label for display purposes in the dashboard. · ID: Associates actions with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found