I use Material Design in new Angular 2. I connected this to app.module like as:
import {MdButtonModule, MdCheckboxModule} from '@angular/material';
import {MdGridListModule, MdCardModule} from '@angular/material';
@NgModule({
imports: [
MdButtonModule,
MdCheckboxModule,
MdGridListModule,
MdCardModule
],
When page is loaded I get errors in console:
VM1967 vendor.bundle.js:63286 Uncaught Error: Template parse errors:
'md-grid-tile' is not a known element:
1. If 'md-grid-tile' is an Angular component, then verify that it is part of this module.
2. If 'md-grid-tile' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<md-grid-list cols="7" rowHeight="2" id="weekly_schedule">
How to fix? I tried any ways.
Full file is with connected material(now it dont give any errors but page is loaded unlimite in browser)
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { CoreModule } from '../core/core.module';
import { SharedModule } from '../shared/shared.module';
import { HomeRoutingModule } from './home-routing.module';
import { HomeComponent } from './home.component';
import { QuoteService } from './quote.service';
import { BrowserModule } from '@angular/platform-browser';
import {MdButtonModule, MdCheckboxModule} from '@angular/material';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {MdGridListModule, MdCardModule} from '@angular/material';
@NgModule({
imports: [
BrowserAnimationsModule,
BrowserModule,
CommonModule,
TranslateModule,
CoreModule,
SharedModule,
HomeRoutingModule,
MdGridListModule
],
declarations: [
HomeComponent
],
providers: [
QuoteService
]
})
export class HomeModule { }
MaterialModule is removed as of 2.0.beta-11 as seen in the changelog, so you have to use mat instead of md. But still changes are going on so you need to track on git hub
Replace MGridListModule to MatGridListModule,also do import as import { MatGridListModule } from '@angular/material';
you will be good to go..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With