I know that many specific questions were asked for this particular error, but after testing the combination of these solutions, no one helps in this package.
ng2-mdf-validation-messages - https://www.npmjs.com/package/ng2-mdf-validation-messages
There is still a problem in GitHub: - https://github.com/d-kostov-dev/ng2-mdf-validation-messages/issues/12
Different solutions for different packages indicate the export of the function and its inclusion through useFactory , but I do not understand how to write for this particular package.
For instance:
import { Ng2MDFValidationMessagesModule } from 'ng2-mdf-validation-messages'; export function Ng2MDFValidationMessagesModuleFactory() { return Ng2MDFValidationMessagesModule.globalConfig({ class: 'text-danger', defaultErrorMessages: { required: 'Default Custom Required Message' } }); } @NgModule({ ... providers: [ { provide: Ng2MDFValidationMessagesModule, useFactory: Ng2MDFValidationMessagesModuleFactory } ], })
It still gives an error when trying to create a completely new application created using ng .
After editing any file and saving, the error will be fixed, and everything will be fine after that, but not the first time.
Add sample code with a fresh install using Angular 4 and this plugin.
Available at https://github.com/kunaldethe/ng4-mdf-validation-messages-example
Configuration:
1. node -v (v6.11.0) 2. npm -v (5.4.2) 3. ng --version @angular/cli: 1.4.9 node: 6.11.0 os: win32 x64 @angular/animations: 4.4.6 @angular/common: 4.4.6 @angular/compiler: 4.4.6 @angular/core: 4.4.6 @angular/forms: 4.4.6 @angular/http: 4.4.6 @angular/platform-browser: 4.4.6 @angular/platform-browser-dynamic: 4.4.6 @angular/router: 4.4.6 @angular/cli: 1.4.9 @angular/compiler-cli: 4.4.6 @angular/language-service: 4.4.6 typescript-formatter: 5.2.0 typescript: 2.3.4
Any help is appreciated.
source share