InfomediaLtd / angular2-materialize

Angular 2 support for Materialize CSS framework.
https://infomedialtd.github.io/angular2-materialize/
MIT License
409 stars 142 forks source link

Toasts throw Cannot find name 'Materialize' error #425

Open markb21 opened 6 years ago

markb21 commented 6 years ago

Hi, I am trying to use toasts in my app but I always get this error: Cannot find name 'Materialize' error

Here is an example app (https://github.com/markbudiak/angular-materialize-starter) where it happens. When you run the app with ng serve --poll=2000 it fails. Do some change in any of the app files like add space and save the file. The app will reload, it will again throw the same error but it will run this time.

Am I using the toast incorrectly? Does anyone know why I am getting this error?

pain0486 commented 6 years ago

Have you tried importing directly from materializecss?

import { toast } from 'materialize-css';

Then use it by saying

toast('I am a funny toast! ', 4500);