ngx-toastr

🍞 Angular Toastr

MIT License

Downloads
1.8M
Stars
2.5K
Committers
54

Bot releases are visible (Hide)

ngx-toastr -

Published by scttcper over 7 years ago

ℹ️ ngx-toastr v4 to v5 breaking changes

  • Supports Angular v4 and drops support for anything lower than 2.4.x. Users of Angular less than v2.4 should stay on ngx-toastr v4.x.x
Required actions for Angular v4:
  • Install animations npm install @angular/animations --save
  • Add and import in root NgModule
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

What happened to 5.0.0?
I'm not sure.

ngx-toastr -

Published by scttcper over 7 years ago

Fixed bugs for component inheritance. If you were extending toast you should update the constructor. The values are now protected instead of private which allows for easier inheritance without Angular AoT. The constructor is only necessary when not using AoT.

constructor(
    protected toastrService: ToastrService,
    public data: ToastData,
    protected toastRef: ToastRef<any>,
    protected appRef: ApplicationRef,
    protected sanitizer: DomSanitizer
  ) {
    super(toastrService, data, toastRef, appRef, sanitizer);
  }
ngx-toastr -

Published by scttcper over 7 years ago

Fixes:

  • shows progress bar again after hover #72
  • tapToDismiss = false should be working now

New:

  • onAction observable passed back from toast creation. This can be used in custom toasts to trigger a selection. This has been added to the pink toast in the demo. #39
ngx-toastr -

Published by scttcper over 7 years ago

fixes #66 and main is now the commonjs bundle

ngx-toastr -

Published by scttcper over 7 years ago

Renamed toastr-ng2 to ngx-toastr. Please point your package.json to the new name.

some slight changes to toast component. Toast classes are now applied before activate()

ngx-toastr -

Published by scttcper over 7 years ago

minor release. upgraded build dependencies. angular-cli26, rollup, etc.

ngx-toastr -

Published by scttcper almost 8 years ago

Adds a onActivateTick Toast Option. fires a ApplicationRef.tick() from the toast component when activated. Might help show the toast if you are showing it from a websocket
See issue #53

ngx-toastr -

Published by scttcper almost 8 years ago

  • add a custom ToastInjector - passes toast config to ToastComponent's constructor
  • add enableHtml to options and allows using html in message #47
  • adds a ToastContainerDirective that allows you to target the div to show toasts #28 find more in the readme.
  • removes BrowserModule for lazy loading #51
  • upgrade overlay (from material 2) to latest
ngx-toastr -

Published by scttcper almost 8 years ago

Fixes an Angular 2.4.x error.

ngx-toastr -

Published by scttcper almost 8 years ago

Use rollup to build the toastr.umd.js #42 @yarrgh

ngx-toastr -

Published by scttcper almost 8 years ago

Adds a UMD compiled toastr.umd.js for systemjs users

ngx-toastr -

Published by scttcper almost 8 years ago

Module is now compiled into es2015 instead of commonjs before deploying to npm. If you're specifically importing this as a commonjs module you should now import it like @angular/core.

If you're using angular-cli there should be no change.

ngx-toastr -

Published by scttcper almost 8 years ago

update to angular-cli v23

ngx-toastr -

Published by scttcper almost 8 years ago

Supports Angular 2.3.x. Thanks @cmckni3 #37
Currently released under npm i toastr-ng2@next

ngx-toastr -

Published by scttcper almost 8 years ago

Changes:
Toast Component attribute toastClasses being private was throwing an AoT error.

ngx-toastr -

Published by scttcper almost 8 years ago

Big thanks to @yarrgh in #34

  • Set global settings more easily
// your @NgModule
imports: [
  ToastrModule.forRoot({ alwaysOnTop: false, timeOut: 10000 })
]
  • new individual settings
this.toastrService.success('message', 'title', {timeOut: 10000 });
  • fixed a bug when setting timeOut = 0
ngx-toastr -

Published by scttcper almost 8 years ago

  • Fixes AoT when setting global settings #32
  • Makes ToastConfig not injectable and no longer provided globally for no reason
  • I believe using forRoot should prevent multiple instances of the service from being started when used properly #30
  • removes provideToastr for settings that should be set inside a component see breaking changes or https://github.com/scttcper/toastr-ng2#override-default-settings

##Breaking changes:

  1. Import the module using ToastrModule.forRoot()

before

@NgModule({
  imports: [
    ToastrModule
  ]
})
export class AppModule { }

after

@NgModule({
  imports: [
    ToastrModule.forRoot()
  ]
})
export class AppModule { }
  1. Inject ToastrConfig, typically in your root component, and customize the values of its properties in order to provide default values for all the timepickers used in the application.
import { ToastrConfig } from 'toastr-ng2';
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(config: ToastrConfig) {
    // your global config here
    config.timeOut = 100;
  }
}
ngx-toastr -

Published by scttcper almost 8 years ago

fixes maxOpened bug when maxOpened is more than 1

ngx-toastr -

Published by scttcper almost 8 years ago

when extendedTimeOut is 0 it will no longer hide immediately #27

ngx-toastr -

Published by scttcper almost 8 years ago

fix insert new toast on top