0

Im using stackblitz code editor and im trying to implement calendar in my app using angular materials but got this error.

enter image description here

here's the link https://stackblitz.com/edit/angular-ivy-2ucboy?file=src/app/app.component.ts

frustrated-dev
  • 431
  • 6
  • 29
  • 1
    Hello, i cant see any problem of importing MatModules. But i see that you bootstrap in main just Datepicker component. Try to bootsrap as default appComponent. – Anton Skybun Oct 07 '20 at 07:57
  • Hi there, please consider providing your code inline as links may go down or be inaccessible at any point. – Edric Oct 07 '20 at 09:48

1 Answers1

2

For some reason, you are bootstrapping your app in main.ts? That's why your actual app.module.ts file is redundant. You need to import the relevant modules into your main.ts file, as that is where your AppModule is declared.

See this working demo.

ViqMontana
  • 5,090
  • 3
  • 19
  • 54
  • its woring fine in angular example https://stackblitz.com/angular/anmqddxqxmy?file=src%2Fmain.ts – frustrated-dev Oct 07 '20 at 08:17
  • your example has been bootstrapped in `main.ts` for other reasons, there's no need for you to do this. If you do, then you'll need to import the relevant modules in `main.ts`. – ViqMontana Oct 07 '20 at 08:21