bradtraversy / meanauthapp

Complete MEAN stack app with authentication
242 stars 152 forks source link

'flash-messages' is not a known element: #53

Open Sonia-Nehdi opened 3 years ago

Sonia-Nehdi commented 3 years ago

'flash-messages' is not a known element:

  1. If 'flash-messages' is an Angular component, then verify that it is part of this module.
  2. If 'flash-messages' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

this error occurs when I try to use even after I installed,

npm install angular2-flash-messages

and imported it in app.module.ts,

import {FlashMessageModule} from 'angular2-flash-messages'

imported that in app.components.ts,

import { FlashMessagesService } from 'angular2-flash-messages/module/flash-messages.service';

I also installed, npm install @angular/common --save

and added FlashMessagesModule.forRoot() in the imports but the error keeps occurring!

PS: I'm using "@angular/cli": "~10.2.0", any help please !?