With new Angular 15 tandalone components became stable, however there is a little problem with this library when using them.
We have to importmodule when app is bootstrapping:
const providers = importProvidersFrom(
...
NotifierModule.withConfig({
position: {
horizontal: { position: 'right' },
vertical: { position: 'top' },
},
behaviour: {
autoHide: 3000,
},
}),
);
bootstrapApplication(AppComponent, {
providers: [
providers,
...
],
}).catch((err) => console.error(err));
and we cannot import Notifier component it self to app.component.ts like this:
@Component({
selector: 'app-root',
standalone: true,
imports: [CommonModule, RouterModule, NotifierNotificationComponent], <--------------- not stand alone
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent implements OnInit, OnDestroy {
instead we have to import module which resets config.
There is a little fix for that - we need to declare notifier as standalone.
With new Angular 15 tandalone components became stable, however there is a little problem with this library when using them.
We have to importmodule when app is bootstrapping:
and we cannot import Notifier component it self to app.component.ts like this:
instead we have to import module which resets config.
There is a little fix for that - we need to declare notifier as standalone.