Angular Material 2: None of the modules are recognized in Angular CLI

I am trying to set up Angular Material 2 in an Angular CLI project. I am using the latest versions. I have added links in the module and component file, but when I try to use it it works. I followed all the steps from the installation instructions from the documentation, but still didn't work. And I have no errors.

I can give an example for the Datepicker component.

import { MdDatepickerModule, MdNativeDateModule } from '@angular/material';
.
.
.
exports: [
   ...
    MdDatepickerModule,
    MdNativeDateModule,
   ...
  ],
  imports: [
   ...
    MdDatepickerModule,
    MdNativeDateModule,
   ...
]

      

Here is my main.ts

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) { 
  enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);

      

+3


source to share





All Articles