Skip to content

Toasts throw Cannot find name 'Materialize' error #425

Open

Description

@markbudiak

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?

Activity

  1. changed the title [-]Using Toasts throws Cannot find name 'Materialize' error[/-] [+]Toasts throws Cannot find name 'Materialize' error[/+] on Apr 11, 2018
  2. changed the title [-]Toasts throws Cannot find name 'Materialize' error[/-] [+]Toasts throw Cannot find name 'Materialize' error[/+] on Apr 11, 2018
  3. pain0486 commented on Apr 27, 2018

    @pain0486

    Have you tried importing directly from materializecss?

    import { toast } from 'materialize-css';

    Then use it by saying

    toast('I am a funny toast! ', 4500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions