Search code examples
angulartypescripttoastr

ng2-toastr with akveo/ng2-admin - CSS not taken into account


I'm using akveo/ng2-admin dashboard (latest with angular 4) and tried to use ng2-toastr following the installation doc.

I imported the CSS in the index.html file and declared the ToastModule in the app.module.ts file.

I also imported the ToastsManager in my component and assigned the ViewContainerRef.

The module gets loaded successfully and everything goes without error so far.

But when I call this.toastr.success('You are awesome!', 'Success!'); the text is displayed without using the CSS.

ng2-admin is using WebPack.

Any idea?

Thanks in advance! Serge.

URL toastr: https://github.com/PointInside/ng2-toastr

URL ng2-admin: enter link description here


Solution

  • I copied the CSS file in the theme folder and loaded it in the app.component.ts with the following command:

    import 'style-loader!./theme/ng2-toastr/ng2-toastr.scss';
    

    Cheers, Serge.