ToastR is one of those programs that provides messages. It’s a replacement to a write statement. What is does is puts a message in the upper right side of the browser window for a moment.
Sending a few ToastR messages will stack the messages. Releasing one at a time until they are all gone.
Typical use
1 | this.toastr.success("The Program has been added into the system."); |
Sample
App.Module.Ts
1 | : |
Toastr is used everywhere so a reference was added to the app.module.ts
It was added to imports block
Program-details.component.ts
1 | : |
In components where I want to use Toastr
- Import the toaster service
- Inject it into the class in the constructor.
- Use it the same way you would use an alert statement..
Note: Code continues immediately after the message is displayed.