Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaterializeCSS 1.0.0-Beta not supported #424

Open
don-charlie-pc opened this issue Apr 8, 2018 · 3 comments
Open

MaterializeCSS 1.0.0-Beta not supported #424

don-charlie-pc opened this issue Apr 8, 2018 · 3 comments
Assignees
Labels
enhancement in-progress This issue is currently being worked on

Comments

@don-charlie-pc
Copy link

Using materialize-css version 1.0.0 does not work with angular2-materialize. Using the component gives this error:

Uncaught Error: Couldn't find Materialize object on window. It is created by the materialize-css library. Please import materialize-css before importing angular2-materialize.

Will you add support for materializecss 1.0.0?

@Julien-Marcou
Copy link

I believe it is due to the fact that "Materialize" has been renamed to "M" for Meteor packages

Before 1.0.0 it was

// Required for Meteor package, the use of window prevents export by Meteor
(function (window) {
  if (window.Package) {
    Materialize = {};
  } else {
    window.Materialize = {};
  }
})(window);

now it is

// Required for Meteor package, the use of window prevents export by Meteor
(function (window) {
  if (window.Package) {
    M = {};
  } else {
    window.M = {};
  }

  // Check for jQuery
  M.jQueryLoaded = !!window.jQuery;
})(window);

Which means Angular2 Materialize should use

if (!("M" in window)) {
  throw new Error("Couldn't find Materialize object on window. It is created by the materialize-css library. Please import materialize-css before importing angular2-materialize.");
}

instead of

if (!("Materialize" in window)) {
  throw new Error("Couldn't find Materialize object on window. It is created by the materialize-css library. Please import materialize-css before importing angular2-materialize.");
}

It seams to fix some problems, but not all of them :S

@Skuriles
Copy link

Can this be added to a PR?

@EnumC EnumC self-assigned this Aug 12, 2018
@EnumC EnumC added enhancement in-progress This issue is currently being worked on labels Aug 12, 2018
@samthomson
Copy link

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement in-progress This issue is currently being worked on
Projects
None yet
Development

No branches or pull requests

5 participants