You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 3, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,10 @@
14
14
15
15
> Reactive forms validation for pros
16
16
17
-
I solely missed `ng-messages` directive from AngularJs, so I created this one to use in Angular 2+.
18
-
In contrast to the one from AngularJs, this one requires you to pass the control name to the directive, instead of its errors.
19
-
This allowed me to hook in to the status of control, like its `dirty` state, and display validation messages according to that status.
20
-
A nice side effect of that decision is less boilerplate code.
17
+
I very much missed the `ng-messages` directive from AngularJS, so I created a similar set of directives to use in Angular 2+.
18
+
In contrast to the directives from AngularJS, the directives in this library require passing the control name to the directive, instead of the control's errors.
19
+
This allowed me to hook into the status of control, such as its `dirty` state, and display validation messages according to that status.
20
+
The design of this library promotes less boilerplate code, which keeps your templates clean.
21
21
22
22
## Features
23
23
@@ -46,20 +46,20 @@ A nice side effect of that decision is less boilerplate code.
46
46
47
47
## Usage
48
48
49
-
Import library into your application module:
49
+
Import library into application module:
50
50
51
51
```ts
52
52
import { NgxErrorsModule } from'@ngspot/ngx-errors'; // <-- import the module
53
53
54
54
@NgModule({
55
55
imports: [
56
-
NgxErrorsModule, // <-- include it in your app module
56
+
NgxErrorsModule, // <-- include imported module in app module
57
57
],
58
58
})
59
59
exportclassMyAppModule {}
60
60
```
61
61
62
-
### Use-case with a form:
62
+
### Usecase with a form:
63
63
64
64
```ts
65
65
@Component({
@@ -85,7 +85,7 @@ export class MyComponent implements OnInit {
85
85
}
86
86
```
87
87
88
-
### Use-case with a simple FormControl:
88
+
### Usecase with a simple FormControl:
89
89
90
90
```ts
91
91
@Component({
@@ -105,7 +105,7 @@ export class MyComponent implements OnInit {
105
105
106
106
## Configuration
107
107
108
-
You configure when to show messages for your whole module by using `.configure()` method:
108
+
Configure when to show messages for whole module by using `.configure()` method:
109
109
110
110
```ts
111
111
@NgModule({
@@ -121,7 +121,7 @@ Alternatively, use dependency injection to provide configuration at a component
0 commit comments