Topic: Alerts with angular

jimsgroup pro asked 7 years ago


I'm following the instructions here https://mdbootstrap.com/angular/advanced/alerts/ It says to add the following to app.component.ts
import {ToastService} from '../../typescripts/pro/alerts'
This shows as unknown for me. Is this an NPM package I need to download? Or is it part of the MDB Pro package?



Dawid Adach pro answered 7 years ago


Dear jimsgroup,   if you are using npm installation, please change
import {ToastService} from '../../typescripts/pro/alerts';
to:
import {ToastService} from 'ng-mdb-pro/pro/';

jimsgroup pro commented 7 years ago

That doesn't work, but this does: import { ToastModule } from 'ng-mdb-pro/pro/index';

Dawid Adach pro commented 7 years ago

Dear jimsgrouop, Toast module is available at index.ts file, while Toast service is available at pro/alerts , the reason behind that is that you should import Toast module only once for root, while service can be implemented in all components whereas you want yo use Toast Service.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No
Tags