question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

md-card NgModule is not a function

See original GitHub issue

Bug, feature request, or proposal:

Bug (?) Version: @angular2-material/card": "^2.0.0-alpha.7 Angular version: RC4 (but tested with RC5 also)

Case is is simple from angular2-material options card is the one that simply cannot work in my case. It is install and accessible through systemJs and the usage is this:

Component:

import { Component, OnInit, Input } from '@angular/core';
import { MenuItems } from '../../../models';
import { MD_CARD_DIRECTIVES } from '@angular2-material/card';

@Component({
  moduleId: module.id,
  selector: 'big-icons-vertical-menu',
  templateUrl: 'big-icons-vertical-menu.component.html',
  styleUrls: ['big-icons-vertical-menu.component.css'],
  directives: [MD_CARD_DIRECTIVES]
})
export class BigIconsVerticalMenuComponent implements OnInit {

  @Input() items: MenuItems;

  constructor() { }

  ngOnInit() {
  }

}

Template (well even if there is no template the issue is the same).

<md-card class="text-center detail-menu">
  <md-card-content>
    Text here
  </md-card-content>
</md-card>

When the app runs and i use the component I get:

zone.js:461 Unhandled Promise rejection: TypeError: core_1.NgModule is not a function at eval (http://localhost:4200/vendor/@angular2-material/core/ripple/ripple.js:168:16) at Object.eval (http://localhost:4200/vendor/@angular2-material/core/ripple/ripple.js:175:2) at eval (http://localhost:4200/vendor/@angular2-material/core/ripple/ripple.js:178:4) at eval (http://localhost:4200/vendor/@angular2-material/core/ripple/ripple.js:179:3) Evaluating http://localhost:4200/vendor/@angular2-material/core/ripple/ripple.js Evaluating http://localhost:4200/vendor/@angular2-material/button/button.js Evaluating http://localhost:4200/app/top-bar/top-bar.component.js Evaluating http://localhost:4200/app/top-bar/index.js Evaluating http://localhost:4200/app/shared/index.js Evaluating http://localhost:4200/app/routes.js Evaluating http://localhost:4200/main.js Error loading http://localhost:4200/main.js ; Zone: <root> ; Task: Promise.then ; Value: Error: TypeError: core_1.NgModule is not a function(…)consoleError @ zone.js:461_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426 zone.js:463 Error: Uncaught (in promise): Error: TypeError: core_1.NgModule is not a function(…)consoleError @ zone.js:463_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426

Maybe there is a relation here with #954 but I cannot add my issue there as it is locked for collaborators only.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jelbourncommented, Aug 10, 2016

I’ve updated my material2-app to use alpha.7 and RC5 with everything working. Looking at that might help debug your issue.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Template parse errors: 'mat-card' is not a known element
In Angular 6. app.module.ts: import { MatCardModule } from '@angular/material'; ... @NgModule({ declarations: [ AppComponent,.
Read more >
Error after importing @angular/material": "^2.0.0-beta.8" #2031
After removing the material.js and I removed the css link from index file. Then did a npm start to reload everything, this time...
Read more >
angular/material2 - Gitter
NgModule is not a function " I this while trying to introduce @angular2 materials and have no idea what I'm doing wrong. Mathijs...
Read more >
How to create dynamic menu and page title with Angular ...
This is done using a template variable #mainSideNav, not defined in the component typescript. The button click triggers the toggle function ...
Read more >
Angular vs. React: Which Is Better for Web Development?
Certain Angular features that stand out but are not in React by default are: ... When the render function of an @observer augmented...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found