validation-messages
v1.0.5
Published
Angular 2 module for displaying validation messages on template driven forms
Downloads
7
Maintainers
Readme
validation-messages - Angular 2 module for displaying validation messages on template driven forms
Demo
View all the directives in action at https://rahulbhooteshwar.github.io/validation-messages
Dependencies
- Angular (requires Angular 4.3.2 or higher, tested with 4.3.2)
Installation
Install above dependencies via npm.
Now install validation-messages
via:
npm install --save validation-messages
SystemJS
Note:If you are using
SystemJS
, you should adjust your configuration to point to the UMD bundle. In your systemjs config file,map
needs to tell the System loader where to look forvalidation-messages
:
map: {
'validation-messages': 'node_modules/validation-messages/bundles/validation-messages.umd.js',
}
Once installed you need to import the main module:
import { ValidationMessagesModule} from 'validation-messages';
The only remaining part is to list the imported module in your application module. The exact method will be slightly
different for the root (top-level) module for which you should end up with the code similar to (notice ValidationMessagesModule .forRoot()
):
import { ValidationMessagesModule } from 'validation-messages';
@NgModule({
declarations: [AppComponent, ...],
imports: [ValidationMessagesModule.forRoot(), ...],
bootstrap: [AppComponent]
})
export class AppModule {
}
Other modules in your application can simply import ValidationMessagesModule
:
import { ValidationMessagesModule } from 'validation-messages';
@NgModule({
declarations: [OtherComponent, ...],
imports: [ValidationMessagesModule, ...],
})
export class OtherModule {
}
Usage
License
Copyright (c) 2017 Rahul Bhooteshwar. Licensed under the MIT License (MIT)