Latest version available for each version of Angular
ngx-toastr-message | Angular |
---|---|
0.1.0 | 18.2.x |
npm i ngx-toastr-message
app.component.ts
import {
NgxToastrMessageComponent,
NgxToastrMessageService,
} from 'ngx-toastr-message';
@Component({
selector: 'app-root',
standalone: true,
imports: [NgxToastrMessageComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
app.component.html
<lib-ngx-toastr-message></lib-ngx-toastr-message>
app.component.ts
private toastrService = inject(NgxToastrMessageService);
showMessage() {
this.toastrService.show('This is a success message!', 'success');
}
this.toastrService.show('This is a success message!', 'success');
this.toastrService.show('This is a error message!', 'error');
this.toastrService.show('This is a info message!', 'info');
this.toastrService.show('This is a warning message!', 'warning');
Change the font size; it should be in pixels.
this.toastrService.show('This is a success message!', 'success', {
fontSize: 14
});
MIT