MDB Angular 4.3.7 ToastService Error


Topic: MDB Angular 4.3.7 ToastService Error

rze pro asked 7 years ago

Hi, For your information, there is a bug in the MDB Angular 4.3.7 version: Module '"/src/app/typescripts/pro/index"' has no exported member 'ToastService' To correct it, you have to put in the /src/app/typescripts/pro/index.ts file: export { ToastService } from './alerts/'; Best regards

dantavious pro commented 7 years ago

Thanks for this post. It really helped me out.

Dawid Adach pro answered 7 years ago

Dear , did you used a fresh copy of MDB or did you upgrade the previous version to 4.3.7 ? In 4.3.7 we have excluded ToastService from Alerts as it has to be loaded separately as singleton. You can find more information on how to import it in our documentation as well as changelog: https://mdbootstrap.com/angular/changelog/ Please follow the instructions, otherwise, you might encounter other issues with Toast while loading MDB in multiple components  

dantavious pro commented 7 years ago

I did use a fresh copy. I tried it again today and receive the following error. ERROR in /data/code/linux/mdb-angular-pro/src/app/app.component.ts (2,10): Module '"/data/code/linux/mdb-angular-pro/src/app/typescripts/pro/index"' has no exported member 'ToastService'. webpack: Failed to compile.

shuailiu.usa pro commented 7 years ago

I got exactly same error.

Don Irwin pro commented 7 years ago

 I downloaded a fresh copy of mdb-angular-pro-4.3.7.zip and get the same error :-(

Dawid Adach pro commented 7 years ago

Guys, please check the docs which I have placed within original answer. There was a change, you SHOULD NOT load ToastModule from import { ToastService } from ‘./typescripts/pro; , but from import {ToastService} from '../../typescripts/pro/alerts'

vizmedia pro answered 7 years ago

The same problem occurred in my newest version. The app.component.ts file must be changed line:
import { ToastService } from './typescripts/pro; to
import { ToastService } from './typescripts/pro/alerts';

Don Irwin pro answered 7 years ago

I downloaded a fresh copy of mdb-angular-pro-4.3.7.zip and get the same error.

Don Irwin pro commented 7 years ago

removing import { ToastService } from ‘./typescripts/pro; from app.component.ts fixed this for me.

Dawid Adach pro commented 7 years ago

Indeed , as per newest docs which I have placed within original answer. There was a change, you SHOULD NOT load ToastModule from import { ToastService } from ‘./typescripts/pro; , but from import {ToastService} from '../../typescripts/pro/alerts'

nselladu pro premium answered 7 years ago

I downloaded a 4.3.7 version. I'm getting the same error.

nselladu pro premium commented 7 years ago

I downloaded again today right now and did npm start. It is working for me now. cheers.

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No